summaryrefslogtreecommitdiff
path: root/ptw32_threadDestroy.c
diff options
context:
space:
mode:
authorrpj <rpj>2003-09-02 16:15:05 +0000
committerrpj <rpj>2003-09-02 16:15:05 +0000
commit879bb0613c03b10bdf91aa862c2463b7f9f99087 (patch)
tree6e91c26a0f16a0e4bfd3ed436f27e470b5db7307 /ptw32_threadDestroy.c
parenta5f3d62017a8e705016d0083a24837d6a56f178d (diff)
Added cancelation of/from non-POSIX threads; minor fixes; minor changes.snap-2003-09-03
Diffstat (limited to 'ptw32_threadDestroy.c')
-rw-r--r--ptw32_threadDestroy.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/ptw32_threadDestroy.c b/ptw32_threadDestroy.c
index 560c084..868b3f3 100644
--- a/ptw32_threadDestroy.c
+++ b/ptw32_threadDestroy.c
@@ -72,8 +72,12 @@ ptw32_threadDestroy (pthread_t thread)
(void) pthread_mutex_destroy(&threadCopy.cancelLock);
#if ! defined (__MINGW32__) || defined (__MSVCRT__)
- /* See documentation for endthread vs endthreadex. */
- if( threadCopy.threadH != 0 )
+ /*
+ * See documentation for endthread vs endthreadex.
+ * Don't close the Win32 handle of implicit POSIX threads
+ * because the process may want to call GetExitCodeThread().
+ */
+ if( threadCopy.threadH != 0 && ! threadCopy.implicit )
{
CloseHandle( threadCopy.threadH );
}