From: Ivan Maidanski Date: Tue, 12 Dec 2017 16:24:02 +0000 (+0300) Subject: Fix gctest failure if compiled with TSan and parallel marker X-Git-Tag: v8.0.0~455 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=029d894d7fa9c511b68d9d85c266d2791d35dd19;p=platform%2Fupstream%2Flibgc.git Fix gctest failure if compiled with TSan and parallel marker As of clang-4.0, Thread Sanitizer does not support creation of threads in the forked process (before exec). So, GC_start_mark_threads() is a no-op now if TSan is enabled. * misc.c [THREADS && PARALLEL_MARK && CAN_HANDLE_FORK] (GC_start_mark_threads): Do not call GC_start_mark_threads_inner() if THREAD_SANITIZER; add comment. --- diff --git a/misc.c b/misc.c index e28fbff..0c40e9b 100644 --- a/misc.c +++ b/misc.c @@ -1343,7 +1343,9 @@ GC_API void GC_CALL GC_enable_incremental(void) #if defined(THREADS) GC_API void GC_CALL GC_start_mark_threads(void) { -# if defined(PARALLEL_MARK) && defined(CAN_HANDLE_FORK) +# if defined(PARALLEL_MARK) && defined(CAN_HANDLE_FORK) \ + && !defined(THREAD_SANITIZER) + /* TSan does not support threads creation in the child process. */ IF_CANCEL(int cancel_state;) DISABLE_CANCEL(cancel_state);