summaryrefslogtreecommitdiff
path: root/pthread_stop_world.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2016-06-21 09:48:21 +0300
committerIvan Maidanski <ivmai@mail.ru>2016-06-21 09:48:21 +0300
commitc651715cd32958d6c6efe3800eb15f6667d4784f (patch)
treeab77bb5f72de4124ac4dc94777b3cd16f981913b /pthread_stop_world.c
parent59e2bcf96430d5ae4e307ac5d8323bf4ea679e47 (diff)
downloadbdwgc-c651715cd32958d6c6efe3800eb15f6667d4784f.tar.gz
Fix GC_suspend_thread for terminated threadsthread-suspend
* pthread_stop_world.c (GC_suspend_thread): Do not clear SUSPENDED_EXT flag in case of RAISE_SIGNAL() failure, add assertion about FINISHED (in case of ESRCH), update comment. * pthread_stop_world.c (GC_register_my_thread): Add assertion that SUSPENDED_EXT flag is not set if the thread is registered from a thread key destructor.
Diffstat (limited to 'pthread_stop_world.c')
-rw-r--r--pthread_stop_world.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/pthread_stop_world.c b/pthread_stop_world.c
index 244731e4..1ee9ee8f 100644
--- a/pthread_stop_world.c
+++ b/pthread_stop_world.c
@@ -433,8 +433,9 @@ STATIC void GC_restart_handler(int sig)
/* TODO: Support GC_retry_signals */
switch (RAISE_SIGNAL(t, GC_sig_suspend)) {
case ESRCH:
- /* Not really there anymore. Possible? */
- t -> flags &= ~SUSPENDED_EXT;
+ /* Not really there anymore (terminated but not joined yet). */
+ /* No need to wait but leave the suspension flag on. */
+ GC_ASSERT((t -> flags & FINISHED) != 0);
UNLOCK();
return;
case 0: