diff options
| author | rpj <rpj> | 2004-11-03 01:08:41 +0000 | 
|---|---|---|
| committer | rpj <rpj> | 2004-11-03 01:08:41 +0000 | 
| commit | ec8290acdaea21b16d98f1ef5d4ae8a28ab2109a (patch) | |
| tree | 0bd3750ec1cc12594b6cfe69473e393da6ec101b /pthread_win32_attach_detach_np.c | |
| parent | cccaf0c2c82e78a72d69a4a50c872f308bed2f65 (diff) | |
Mutex, semaphore, thread ID, test suite changes - see ChangeLogs
Diffstat (limited to 'pthread_win32_attach_detach_np.c')
| -rw-r--r-- | pthread_win32_attach_detach_np.c | 46 | 
1 files changed, 22 insertions, 24 deletions
| diff --git a/pthread_win32_attach_detach_np.c b/pthread_win32_attach_detach_np.c index 4aedccc..6fd7f27 100644 --- a/pthread_win32_attach_detach_np.c +++ b/pthread_win32_attach_detach_np.c @@ -92,8 +92,6 @@ pthread_win32_process_attach_np ()  #endif -#ifndef TEST_ICE -    /*     * Load KERNEL32 and try to get address of InterlockedCompareExchange     */ @@ -136,12 +134,6 @@ pthread_win32_process_attach_np ()        ptw32_features |= PTW32_SYSTEM_INTERLOCKED_COMPARE_EXCHANGE;      } -#else /* TEST_ICE */ - -  ptw32_interlocked_compare_exchange = ptw32_InterlockedCompareExchange; - -#endif /* TEST_ICE */ -    /*     * Load QUSEREX.DLL and try to get address of QueueUserAPCEx     */ @@ -204,16 +196,19 @@ pthread_win32_process_detach_np ()  {    if (ptw32_processInitialized)      { -      pthread_t self = (pthread_t) pthread_getspecific (ptw32_selfThreadKey); +      ptw32_thread_t * sp = (ptw32_thread_t *) pthread_getspecific (ptw32_selfThreadKey); -      /* -       * Detached threads have their resources automatically -       * cleaned up upon exit (others must be 'joined'). -       */ -      if (self != NULL && self->detachState == PTHREAD_CREATE_DETACHED) +      if (sp != NULL)  	{ -	  ptw32_threadDestroy (self); -	  TlsSetValue (ptw32_selfThreadKey->key, NULL); +	  /* +	   * Detached threads have their resources automatically +	   * cleaned up upon exit (others must be 'joined'). +	   */ +	  if (sp->detachState == PTHREAD_CREATE_DETACHED) +	    { +	      ptw32_threadDestroy (sp->ptHandle); +	      TlsSetValue (ptw32_selfThreadKey->key, NULL); +	    }  	}        /* @@ -265,16 +260,19 @@ pthread_win32_thread_detach_np ()         * Don't use pthread_self() - to avoid creating an implicit POSIX thread handle         * unnecessarily.         */ -      pthread_t self = (pthread_t) pthread_getspecific (ptw32_selfThreadKey); +      ptw32_thread_t * sp = (ptw32_thread_t *) pthread_getspecific (ptw32_selfThreadKey); -      /* -       * Detached threads have their resources automatically -       * cleaned up upon exit (others must be 'joined'). -       */ -      if (self != NULL && self->detachState == PTHREAD_CREATE_DETACHED) +      if (sp != NULL)  	{ -	  ptw32_threadDestroy (self); -	  TlsSetValue (ptw32_selfThreadKey->key, NULL); +	  /* +	   * Detached threads have their resources automatically +	   * cleaned up upon exit (others must be 'joined'). +	   */ +	  if (sp->detachState == PTHREAD_CREATE_DETACHED) +	    { +	      ptw32_threadDestroy (sp->ptHandle); +	      TlsSetValue (ptw32_selfThreadKey->key, NULL); +	    }  	}      } | 
