cvs: TSRM / TSRM.c TSRM.h
| From: | Venkat Raghavan S | Date: | Tue, 28 May 2002 08:54:17 +0000 |
| Subject: | cvs: TSRM / TSRM.c TSRM.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-12126@lists.php.net to get a copy of this message | ||
rvenkat Tue May 28 04:54:17 2002 EDT
Modified files:
/TSRM TSRM.h TSRM.c
Log:
Basic NetWare changes
Index: TSRM/TSRM.h
diff -u TSRM/TSRM.h:1.32 TSRM/TSRM.h:1.33
--- TSRM/TSRM.h:1.32 Thu Mar 7 10:07:49 2002
+++ TSRM/TSRM.h Tue May 28 04:54:17 2002
@@ -36,6 +36,9 @@
#ifdef TSRM_WIN32
# include <windows.h>
+#elif defined(NETWARE)
+# include <nks/thread.h>
+# include <nks/synch.h>
#elif defined(GNUPTH)
# include <pth.h>
#elif defined(PTHREADS)
@@ -50,6 +53,9 @@
#ifdef TSRM_WIN32
# define THREAD_T DWORD
# define MUTEX_T CRITICAL_SECTION *
+#elif defined(NETWARE)
+# define THREAD_T NXThreadId_t
+# define MUTEX_T NXMutex_t *
#elif defined(GNUPTH)
# define THREAD_T pth_t
# define MUTEX_T pth_mutex_t *
Index: TSRM/TSRM.c
diff -u TSRM/TSRM.c:1.42 TSRM/TSRM.c:1.43
--- TSRM/TSRM.c:1.42 Mon Jul 30 01:46:31 2001
+++ TSRM/TSRM.c Tue May 28 04:54:17 2002
@@ -412,6 +412,8 @@
{
#ifdef TSRM_WIN32
return GetCurrentThreadId();
+#elif defined(NETWARE)
+ return NXThreadGetId();
#elif defined(GNUPTH)
return pth_self();
#elif defined(PTHREADS)
@@ -430,10 +432,17 @@
TSRM_API MUTEX_T tsrm_mutex_alloc(void)
{
MUTEX_T mutexp;
+#ifdef NETWARE
+ long flags = 0; /* Don't require NX_MUTEX_RECURSIVE, I guess */
+ NXHierarchy_t order = 0;
+ NX_LOCK_INFO_ALLOC (lockInfo, "PHP-TSRM", 0);
+#endif
#ifdef TSRM_WIN32
mutexp = malloc(sizeof(CRITICAL_SECTION));
InitializeCriticalSection(mutexp);
+#elif defined(NETWARE)
+ mutexp = NXMutexAlloc(flags, order, &lockInfo); /* return value ignored for now */
#elif defined(GNUPTH)
mutexp = (MUTEX_T) malloc(sizeof(*mutexp));
pth_mutex_init(mutexp);
@@ -460,6 +469,8 @@
if (mutexp) {
#ifdef TSRM_WIN32
DeleteCriticalSection(mutexp);
+#elif defined(NETWARE)
+ NXMutexFree(mutexp);
#elif defined(GNUPTH)
free(mutexp);
#elif defined(PTHREADS)
@@ -486,6 +497,8 @@
#ifdef TSRM_WIN32
EnterCriticalSection(mutexp);
return 1;
+#elif defined(NETWARE)
+ return NXLock(mutexp);
#elif defined(GNUPTH)
return pth_mutex_acquire(mutexp, 0, NULL);
#elif defined(PTHREADS)
@@ -507,6 +520,8 @@
#ifdef TSRM_WIN32
LeaveCriticalSection(mutexp);
return 1;
+#elif defined(NETWARE)
+ return NXUnlock(mutexp);
#elif defined(GNUPTH)
return pth_mutex_release(mutexp);
#elif defined(PTHREADS)