Fix GC_remove_specific invocation from remove_all_threads_but_me
authorIvan Maidanski <ivmai@mail.ru>
Mon, 28 Aug 2017 06:27:07 +0000 (09:27 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 28 Aug 2017 07:46:55 +0000 (10:46 +0300)
commit6383cee08869517ec3dee257d0adb582c4fc7805
treed8e2caa793f41722461489048ce0929ad334b3e0
parenteb41b8b6ad7efbf740db8c717a2e019cb0bb71d3
Fix GC_remove_specific invocation from remove_all_threads_but_me
(fix commits fcfae7f, 38e65ea)

* include/private/specific.h (GC_remove_specific): Define as macro
(calls GC_remove_specific_after_fork).
* include/private/specific.h (GC_remove_specific_after_fork): New
GC_INNER function declaration.
* include/private/thread_local_alloc.h [USE_PTHREAD_SPECIFIC
|| USE_COMPILER_TLS || USE_WIN32_COMPILER_TLS || USE_WIN32_SPECIFIC]
(GC_remove_specific_after_fork): New macro (defined to no-op).
* pthread_support.c [CAN_HANDLE_FORK && THREAD_LOCAL_ALLOC]
(GC_remove_all_threads_but_me): Call GC_remove_specific_after_fork
instead of GC_remove_specific (i.e. delete thread-specific control data
for the given thread instead of the current one).
* win32_threads.c [CAN_HANDLE_FORK && THREAD_LOCAL_ALLOC] Like
* specific.c [USE_CUSTOM_SPECIFIC] (GC_setspecific): Add assertion that
the allocation lock is held; remove the corresponding comment.
* specific.c [USE_CUSTOM_SPECIFIC] (GC_remove_specific): Replace to
GC_remove_specific_after_fork (add t argument); replace self local
variable with t argument; update comment;
* specific.c [USE_CUSTOM_SPECIFIC && CAN_HANDLE_FORK]
(GC_remove_specific_after_fork): Add assertion that the allocation lock
is held; add comment.
include/private/specific.h
include/private/thread_local_alloc.h
pthread_support.c
specific.c
win32_threads.c