From: Adrian Pop Date: Fri, 10 Jun 2016 17:39:18 +0000 (+0300) Subject: Workaround a bug in winpthreads causing parallel marks deadlock (MinGW) X-Git-Tag: gc7_6_0~32 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fb39e721b04b75aff75a2b8e45318f0fc060263e;p=gc Workaround a bug in winpthreads causing parallel marks deadlock (MinGW) The solution is to use Win32 threads for parallel markers while using winpthreads to provide GC-aware pthread_create/join/detach and fork. See details in GitHub issue #81 and issue #119. * win32_threads.c (GC_PTHREADS_PARAMARK): Do not define if GC_PTHREADS, PARALLEL_MARK and __MINGW32__ (to workaround a deadlock in do_sema_b_wait() of winpthreads). --- diff --git a/win32_threads.c b/win32_threads.c index 91d6da2a..e1c004c5 100644 --- a/win32_threads.c +++ b/win32_threads.c @@ -1686,7 +1686,12 @@ GC_INNER void GC_get_next_stack(char *start, char *limit, # if defined(GC_PTHREADS) && !defined(GC_PTHREADS_PARAMARK) /* Use pthread-based parallel mark implementation. */ -# define GC_PTHREADS_PARAMARK + + /* Workaround a deadlock in winpthreads-3.0b internals (observed */ + /* with MinGW 32/64). */ +# if !defined(__MINGW32__) +# define GC_PTHREADS_PARAMARK +# endif # endif # if !defined(GC_PTHREADS_PARAMARK)