Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/cygtls.cc')
-rw-r--r--winsup/cygwin/cygtls.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/winsup/cygwin/cygtls.cc b/winsup/cygwin/cygtls.cc
index 83a62f1ae..84170ca01 100644
--- a/winsup/cygwin/cygtls.cc
+++ b/winsup/cygwin/cygtls.cc
@@ -180,7 +180,7 @@ _cygtls::remove (DWORD wait)
debug_printf ("wait %u", wait);
- cygheap->remove_tls (this, INFINITE);
+ HANDLE mutex = cygheap->remove_tls (this);
remove_wq (wait);
/* FIXME: Need some sort of atthreadexit function to allow things like
@@ -211,6 +211,11 @@ _cygtls::remove (DWORD wait)
/* Close timer handle. */
if (locals.cw_timer)
NtClose (locals.cw_timer);
+ if (mutex)
+ {
+ ReleaseMutex (mutex);
+ CloseHandle (mutex);
+ }
}
#ifdef __x86_64__