summaryrefslogtreecommitdiff
path: root/pthread_support.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2017-11-22 11:35:08 +0300
committerIvan Maidanski <ivmai@mail.ru>2017-11-22 11:35:08 +0300
commitcfdc86ff38a5dfd2363f204bf6a0c55f402bdace (patch)
tree8e5df088a0047192acaefe150372eeb9ccdddb46 /pthread_support.c
parent20468dd131d82be7422aea3c7383ec9201452fce (diff)
downloadbdwgc-cfdc86ff38a5dfd2363f204bf6a0c55f402bdace.tar.gz
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.
Diffstat (limited to 'pthread_support.c')
-rw-r--r--pthread_support.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/pthread_support.c b/pthread_support.c
index cbb66c50..90602de2 100644
--- a/pthread_support.c
+++ b/pthread_support.c
@@ -528,11 +528,6 @@ void GC_push_thread_structures(void)
/* It may not be safe to allocate when we register the first thread. */
static struct GC_Thread_Rep first_thread;
-#define THREAD_TABLE_INDEX(id) \
- (int)(((NUMERIC_THREAD_ID(id) >> 16) \
- ^ (NUMERIC_THREAD_ID(id) >> 8) \
- ^ NUMERIC_THREAD_ID(id)) % THREAD_TABLE_SZ)
-
/* Add a thread to GC_threads. We assume it wasn't already there. */
/* Caller holds allocation lock. */
STATIC GC_thread GC_new_thread(pthread_t id)