Eliminate TSan false positive for stop_info.stack_ptr (v2)
authorIvan Maidanski <ivmai@mail.ru>
Wed, 29 Nov 2017 08:46:05 +0000 (11:46 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 29 Nov 2017 12:52:14 +0000 (15:52 +0300)
commit8e058bbfe6215bb8278554cbf35f93b562ab0f01
tree447983f758a3a72f6350711dcfa86438a1959916
parentb9d8493c7a988edef552a19a55b59ae168296fe5
Eliminate TSan false positive for stop_info.stack_ptr (v2)

Without this patch, Thread Sanitizer reports a data race between
GC_has_other_debug_info() and the code which sets stop_info.stack_ptr.

* include/private/pthread_support.h [THREAD_SANITIZER]: Include
dbg_mlc.h file.
* include/private/pthread_support.h [THREAD_SANITIZER] (GC_Thread_Rep):
Add dummy field (as the first field of the structure).
* pthread_support.c [THREAD_SANITIZER && CPPCHECK] (GC_new_thread):
Call GC_noop1(first_thread.dummy[0]) (to suppress cppcheck warning
about unused field).
include/private/pthread_support.h
pthread_support.c