summaryrefslogtreecommitdiff
path: root/pthread_win32_attach_detach_np.c
diff options
context:
space:
mode:
authorrpj <rpj>2005-05-16 15:43:03 +0000
committerrpj <rpj>2005-05-16 15:43:03 +0000
commit8d2f6ea2182f796450bfd49401349d8e75d38f5b (patch)
tree4409e198d24100c5f1a460b5296054a56f15dd89 /pthread_win32_attach_detach_np.c
parent09799a6fc1b6fca7e82c8e8ec3c1bdc06548e425 (diff)
''
Diffstat (limited to 'pthread_win32_attach_detach_np.c')
-rw-r--r--pthread_win32_attach_detach_np.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/pthread_win32_attach_detach_np.c b/pthread_win32_attach_detach_np.c
index 191b0b0..d839c70 100644
--- a/pthread_win32_attach_detach_np.c
+++ b/pthread_win32_attach_detach_np.c
@@ -263,6 +263,8 @@ pthread_win32_thread_detach_np ()
if (sp != NULL) // otherwise Win32 thread with no implicit POSIX handle.
{
+ HANDLE threadH = sp->threadH;
+
ptw32_callUserDestroyRoutines (sp->ptHandle);
(void) pthread_mutex_lock (&sp->cancelLock);
@@ -277,15 +279,10 @@ pthread_win32_thread_detach_np ()
{
ptw32_threadDestroy (sp->ptHandle);
-#if ! defined (__MINGW32__) || defined (__MSVCRT__) || defined (__DMC__)
- /*
- * See documentation for endthread vs endthreadex.
- */
- if (sp->threadH != 0)
+ if (threadH != 0)
{
- CloseHandle (sp->threadH);
+ CloseHandle (threadH);
}
-#endif
TlsSetValue (ptw32_selfThreadKey->key, NULL);
}