summaryrefslogtreecommitdiff
path: root/pthread_support.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_support.c
parent59e2bcf96430d5ae4e307ac5d8323bf4ea679e47 (diff)
downloadbdwgc-thread-suspend.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_support.c')
-rw-r--r--pthread_support.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/pthread_support.c b/pthread_support.c
index d9f935f7..d0c9cb10 100644
--- a/pthread_support.c
+++ b/pthread_support.c
@@ -1617,6 +1617,7 @@ GC_API int GC_CALL GC_register_my_thread(const struct GC_stack_base *sb)
} else if ((me -> flags & FINISHED) != 0) {
/* This code is executed when a thread is registered from the */
/* client thread key destructor. */
+ GC_ASSERT((me -> flags & SUSPENDED_EXT) == 0);
GC_record_stack_base(me, sb);
me -> flags &= ~FINISHED; /* but not DETACHED */
# ifdef GC_EXPLICIT_SIGNALS_UNBLOCK