]> granicus.if.org Git - gc/commitdiff
Fix double lock in pthread_detach (Cygwin, winpthreads)
authorIvan Maidanski <ivmai@mail.ru>
Mon, 25 Sep 2017 22:12:30 +0000 (01:12 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 29 Sep 2017 21:04:56 +0000 (00:04 +0300)
* win32_threads.c [GC_PTHREADS] (GC_pthread_detach): Do not hold the
allocation lock when GC_lookup_pthread is invoked.

win32_threads.c

index 23acb3bb004612fd0143a3b045f9acc4e4dda4ed..a94e13014d5159a60d20d3cca724350fb3918555 100644 (file)
@@ -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");