Workaround TSan false positive in lookup_thread called by suspend_handler
authorIvan Maidanski <ivmai@mail.ru>
Wed, 22 Nov 2017 08:35:08 +0000 (11:35 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 22 Nov 2017 08:35:08 +0000 (11:35 +0300)
commitcfdc86ff38a5dfd2363f204bf6a0c55f402bdace
tree8e5df088a0047192acaefe150372eeb9ccdddb46
parent20468dd131d82be7422aea3c7383ec9201452fce
Workaround TSan false positive in lookup_thread called by suspend_handler

* include/private/pthread_support.h (THREAD_TABLE_INDEX): Move the
macro from pthread_support.c file.
* pthread_stop_world.c [!GC_OPENBSD_UTHREADS && !NACL
&& THREAD_SANITIZER] (GC_lookup_thread_async): New static function
(same implementation as of GC_lookup_thread but with
GC_ATTR_NO_SANITIZE_THREAD attribute); add comment.
* pthread_stop_world.c [!GC_OPENBSD_UTHREADS && !NACL
&& !THREAD_SANITIZER] (GC_lookup_thread_async): Define as macro.
* pthread_stop_world.c [!GC_OPENBSD_UTHREADS && !NACL]
(GC_suspend_handler_inner): Call GC_lookup_thread_async() instead of
GC_lookup_thread(); move the corresponding comment to
GC_lookup_thread_async.
include/private/pthread_support.h
pthread_stop_world.c
pthread_support.c