diff options
author | rpj <rpj> | 2004-05-17 01:38:02 +0000 |
---|---|---|
committer | rpj <rpj> | 2004-05-17 01:38:02 +0000 |
commit | 771465fed0cf50ee2dd790723245fc091699c324 (patch) | |
tree | d8c18d095a33fe7c4564bd90c5f313bb9e4057dd /ptw32_threadDestroy.c | |
parent | 8b14911744f58cbe3730703f3fcc41cd969fd0f3 (diff) |
re-indentation, bug fixes, hooks for pre-emptive async cancelation
Diffstat (limited to 'ptw32_threadDestroy.c')
-rw-r--r-- | ptw32_threadDestroy.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/ptw32_threadDestroy.c b/ptw32_threadDestroy.c index be6542a..9432e2e 100644 --- a/ptw32_threadDestroy.c +++ b/ptw32_threadDestroy.c @@ -46,22 +46,22 @@ ptw32_threadDestroy (pthread_t thread) if (thread != NULL) { - (void) pthread_mutex_lock(&thread->cancelLock); + (void) pthread_mutex_lock (&thread->cancelLock); thread->state = PThreadStateLast; - (void) pthread_mutex_unlock(&thread->cancelLock); + (void) pthread_mutex_unlock (&thread->cancelLock); ptw32_callUserDestroyRoutines (thread); /* * Copy thread state so that the thread can be atomically NULLed. */ - memcpy(&threadCopy, thread, sizeof(threadCopy)); + memcpy (&threadCopy, thread, sizeof (threadCopy)); /* * Thread ID structs are never freed. They're NULLed and reused. * This also sets the thread to PThreadStateInitial (invalid). */ - ptw32_threadReusePush(thread); + ptw32_threadReusePush (thread); /* Now work on the copy. */ if (threadCopy.cancelEvent != NULL) @@ -78,13 +78,12 @@ ptw32_threadDestroy (pthread_t thread) * Don't close the Win32 handle of implicit POSIX threads * because the process may want to call GetExitCodeThread(). */ - if( threadCopy.threadH != 0 && ! threadCopy.implicit ) + if (threadCopy.threadH != 0 && !threadCopy.implicit) { - CloseHandle( threadCopy.threadH ); + CloseHandle (threadCopy.threadH); } #endif } } /* ptw32_threadDestroy */ - |