From 29a6490c63b7581ae20361b64c4ad28350a1bbbc Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Tue, 26 Sep 2017 01:12:30 +0300 Subject: [PATCH] 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. --- win32_threads.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/win32_threads.c b/win32_threads.c index 23acb3bb..a94e1301 100644 --- a/win32_threads.c +++ b/win32_threads.c @@ -2654,9 +2654,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"); -- 2.40.0