summaryrefslogtreecommitdiff
path: root/TSRM/TSRM.c
diff options
context:
space:
mode:
authorJames Cox <imajes@php.net>2003-06-23 01:27:13 +0000
committerJames Cox <imajes@php.net>2003-06-23 01:27:13 +0000
commit76f85107e263d73b9440bdda88df2845c1ce8734 (patch)
treefbdf79a783fa3c634970de27e1261b5218f55b8f /TSRM/TSRM.c
parentd4cd1ef0843d0ef118cec86fa585517ac91d9cac (diff)
downloadphp-git-76f85107e263d73b9440bdda88df2845c1ce8734.tar.gz
bring head into sync with the php4 branch
Diffstat (limited to 'TSRM/TSRM.c')
-rw-r--r--TSRM/TSRM.c48
1 files changed, 4 insertions, 44 deletions
diff --git a/TSRM/TSRM.c b/TSRM/TSRM.c
index f39114d770..7f6ea1f232 100644
--- a/TSRM/TSRM.c
+++ b/TSRM/TSRM.c
@@ -158,9 +158,6 @@ TSRM_API void tsrm_shutdown(void)
next_p = p->next;
for (j=0; j<id_count; j++) {
- if (resource_types_table && resource_types_table[j].dtor) {
- resource_types_table[j].dtor(p->storage[j], &p->storage);
- }
free(p->storage[j]);
}
free(p->storage);
@@ -293,15 +290,6 @@ TSRM_API void *ts_resource_ex(ts_rsrc_id id, THREAD_T *th_id)
int hash_value;
tsrm_tls_entry *thread_resources;
-#ifdef NETWARE
- /* The below if loop is added for NetWare to fix an abend while unloading PHP
- * when an Apache unload command is issued on the system console.
- * While exiting from PHP, at the end for some reason, this function is called
- * with tsrm_tls_table = NULL. When this happened, the server abends when
- * tsrm_tls_table is accessed since it is NULL.
- */
- if(tsrm_tls_table) {
-#endif
if (!th_id) {
#if defined(PTHREADS)
/* Fast path for looking up the resources for the current
@@ -364,9 +352,6 @@ TSRM_API void *ts_resource_ex(ts_rsrc_id id, THREAD_T *th_id)
* changes to the structure as we read it.
*/
TSRM_SAFE_RETURN_RSRC(thread_resources->storage, id, thread_resources->count);
-#ifdef NETWARE
- } /* if(tsrm_tls_table) */
-#endif
}
@@ -434,12 +419,7 @@ TSRM_API THREAD_T tsrm_thread_id(void)
#ifdef TSRM_WIN32
return GetCurrentThreadId();
#elif defined(NETWARE)
- /* There seems to be some problem with the LibC call: NXThreadGetId().
- * Due to this, the PHPMyAdmin application is abending in PHP calls.
- * Used the call, kCurrentThread instead and it works fine.
- */
-/* return NXThreadGetId(); */
- return kCurrentThread();
+ return NXThreadGetId();
#elif defined(GNUPTH)
return pth_self();
#elif defined(PTHREADS)
@@ -461,23 +441,16 @@ TSRM_API MUTEX_T tsrm_mutex_alloc(void)
{
MUTEX_T mutexp;
#ifdef NETWARE
-#ifndef USE_MPK
- /* To use the Recursive Mutex Locking of LibC */
- long flags = NX_MUTEX_RECURSIVE;
+ long flags = 0; /* Don't require NX_MUTEX_RECURSIVE, I guess */
NXHierarchy_t order = 0;
NX_LOCK_INFO_ALLOC (lockInfo, "PHP-TSRM", 0);
-#endif
-#endif
+#endif
#ifdef TSRM_WIN32
mutexp = malloc(sizeof(CRITICAL_SECTION));
InitializeCriticalSection(mutexp);
#elif defined(NETWARE)
-#ifdef USE_MPK
- mutexp = kMutexAlloc((BYTE*)"PHP-TSRM");
-#else
- mutexp = NXMutexAlloc(flags, order, &lockInfo);
-#endif
+ mutexp = NXMutexAlloc(flags, order, &lockInfo); /* return value ignored for now */
#elif defined(GNUPTH)
mutexp = (MUTEX_T) malloc(sizeof(*mutexp));
pth_mutex_init(mutexp);
@@ -508,13 +481,8 @@ TSRM_API void tsrm_mutex_free(MUTEX_T mutexp)
if (mutexp) {
#ifdef TSRM_WIN32
DeleteCriticalSection(mutexp);
- free(mutexp);
#elif defined(NETWARE)
-#ifdef USE_MPK
- kMutexFree(mutexp);
-#else
NXMutexFree(mutexp);
-#endif
#elif defined(GNUPTH)
free(mutexp);
#elif defined(PTHREADS)
@@ -545,11 +513,7 @@ TSRM_API int tsrm_mutex_lock(MUTEX_T mutexp)
EnterCriticalSection(mutexp);
return 1;
#elif defined(NETWARE)
-#ifdef USE_MPK
- return kMutexLock(mutexp);
-#else
return NXLock(mutexp);
-#endif
#elif defined(GNUPTH)
return pth_mutex_acquire(mutexp, 0, NULL);
#elif defined(PTHREADS)
@@ -576,11 +540,7 @@ TSRM_API int tsrm_mutex_unlock(MUTEX_T mutexp)
LeaveCriticalSection(mutexp);
return 1;
#elif defined(NETWARE)
-#ifdef USE_MPK
- return kMutexUnlock(mutexp);
-#else
return NXUnlock(mutexp);
-#endif
#elif defined(GNUPTH)
return pth_mutex_release(mutexp);
#elif defined(PTHREADS)