summaryrefslogtreecommitdiff
path: root/ptw32_threadDestroy.c
diff options
context:
space:
mode:
authorrpj <rpj>2005-05-18 14:35:16 +0000
committerrpj <rpj>2005-05-18 14:35:16 +0000
commit2f7259b53b446762a1178150b0762c734b85c206 (patch)
tree517e8077e3f4689d2ac331d7000757994cebfd2b /ptw32_threadDestroy.c
parent2531397c796d14f5fb934ae3fcf3c5327bd41bc9 (diff)
''
Diffstat (limited to 'ptw32_threadDestroy.c')
-rw-r--r--ptw32_threadDestroy.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/ptw32_threadDestroy.c b/ptw32_threadDestroy.c
index aa95e2c..eb9abfc 100644
--- a/ptw32_threadDestroy.c
+++ b/ptw32_threadDestroy.c
@@ -66,6 +66,17 @@ ptw32_threadDestroy (pthread_t thread)
(void) pthread_mutex_destroy(&threadCopy.cancelLock);
(void) pthread_mutex_destroy(&threadCopy.threadLock);
+
+#if ! defined (__MINGW32__) || defined (__MSVCRT__) || defined (__DMC__)
+ /*
+ * See documentation for endthread vs endthreadex.
+ */
+ if (threadCopy.threadH != 0)
+ {
+ CloseHandle (threadCopy.threadH);
+ }
+#endif
+
}
} /* ptw32_threadDestroy */