From: Ivan Maidanski Date: Mon, 25 Sep 2017 22:12:30 +0000 (+0300) Subject: Fix double lock in pthread_detach (Cygwin, winpthreads) X-Git-Tag: v8.0.0~574 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b785014a6f8d6d6afb3521fd235e125c43e6028b;p=gc Fix double lock in pthread_detach (Cygwin, winpthreads) * win32_threads.c [GC_PTHREADS] (GC_pthread_detach): Do not hold the allocation lock when GC_lookup_pthread is invoked. --- diff --git a/win32_threads.c b/win32_threads.c index a99eec1a..24f16dbe 100644 --- a/win32_threads.c +++ b/win32_threads.c @@ -2715,9 +2715,7 @@ GC_INNER void GC_thr_init(void) DCL_LOCK_STATE; GC_ASSERT(!GC_win32_dll_threads); - LOCK(); t = GC_lookup_pthread(thread); - UNLOCK(); result = pthread_detach(thread); if (result == 0) { if (NULL == t) ABORT("Thread not registered");