summaryrefslogtreecommitdiff
path: root/pthread_stop_world.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2022-04-01 12:30:08 +0300
committerIvan Maidanski <ivmai@mail.ru>2022-04-01 12:30:08 +0300
commitdeba6eb5b05beb9c3e6cb4652491300c633e194c (patch)
treec415657633586b49d2bee5299a993600af215882 /pthread_stop_world.c
parent162141e8cb0c1f6d259efea9b324792d1e675af4 (diff)
downloadbdwgc-deba6eb5b05beb9c3e6cb4652491300c633e194c.tar.gz
Workaround GCC TSan false positive in GC_lookup_thread_async
It looks like attribute((no_sanitize_thread)) has no effect if the function is inlined in case of gcc compiler (as of gcc 11.1.0). * pthread_stop_world.c [!GC_OPENBSD_UTHREADS && !NACL && THREAD_SANITIZER] (GC_lookup_thread_async): Add GC_ATTR_NOINLINE attribute.
Diffstat (limited to 'pthread_stop_world.c')
-rw-r--r--pthread_stop_world.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pthread_stop_world.c b/pthread_stop_world.c
index 808673ed..26dcd79f 100644
--- a/pthread_stop_world.c
+++ b/pthread_stop_world.c
@@ -286,7 +286,7 @@ STATIC void GC_suspend_handler_inner(ptr_t dummy, void *context);
#ifdef THREAD_SANITIZER
/* The implementation of the function is the same as that of */
/* GC_lookup_thread except for the attribute added here. */
- GC_ATTR_NO_SANITIZE_THREAD
+ GC_ATTR_NOINLINE GC_ATTR_NO_SANITIZE_THREAD
static GC_thread GC_lookup_thread_async(pthread_t id)
{
GC_thread p = GC_threads[THREAD_TABLE_INDEX(id)];