diff options
Diffstat (limited to 'ptw32_threadDestroy.c')
-rw-r--r-- | ptw32_threadDestroy.c | 11 |
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 */ |