summaryrefslogtreecommitdiff
path: root/pthread_win32_attach_detach_np.c
diff options
context:
space:
mode:
Diffstat (limited to 'pthread_win32_attach_detach_np.c')
-rw-r--r--pthread_win32_attach_detach_np.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/pthread_win32_attach_detach_np.c b/pthread_win32_attach_detach_np.c
index 5bbd925..7911fe1 100644
--- a/pthread_win32_attach_detach_np.c
+++ b/pthread_win32_attach_detach_np.c
@@ -283,7 +283,7 @@ pthread_win32_thread_detach_np ()
*/
ptw32_thread_t * sp = (ptw32_thread_t *) pthread_getspecific (ptw32_selfThreadKey);
- if (sp != NULL)
+ if (sp != NULL) // otherwise Win32 thread with no implicit POSIX handle.
{
ptw32_callUserDestroyRoutines (sp->ptHandle);
@@ -291,16 +291,10 @@ pthread_win32_thread_detach_np ()
sp->state = PThreadStateLast;
/*
* If the thread is joinable at this point then it MUST be joined
- * or detached explicitly by the application because it's
- * detachState cannot be changed from this point on.
+ * or detached explicitly by the application.
*/
(void) pthread_mutex_unlock (&sp->cancelLock);
- /*
- * No race condition here because detachState will not be changed
- * elsewhere now that thread state is PThreadStateLast (set above
- * behind mutex).
- */
if (sp->detachState == PTHREAD_CREATE_DETACHED)
{
ptw32_threadDestroy (sp->ptHandle);