summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2013-07-10 10:19:09 +0200
committerIvan Maidanski <ivmai@mail.ru>2013-07-10 10:19:09 +0200
commit4c636aa96c80d80d0758d49a1ee67c4e6fe3f65f (patch)
tree54bfe91df33dee5354eaa30ff0979c84cbaebbbc
parentca89b8c4820836daecb2b1ab4431808721d33f1f (diff)
Check that SIG_SUSPEND and SIG_THR_RESTART are different (Pthreads)
* pthread_stop_world.c (GC_stop_init): Add a check that GC_sig_suspend value differs from that of GC_sig_thr_restart (abort otherwise).
-rw-r--r--pthread_stop_world.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/pthread_stop_world.c b/pthread_stop_world.c
index 9d31c14..e633b0f 100644
--- a/pthread_stop_world.c
+++ b/pthread_stop_world.c
@@ -883,6 +883,8 @@ GC_INNER void GC_stop_init(void)
act.sa_handler = GC_suspend_handler;
# endif
/* act.sa_restorer is deprecated and should not be initialized. */
+ if (GC_sig_suspend == GC_sig_thr_restart)
+ ABORT("Cannot use same signal for thread suspend and resume");
if (sigaction(GC_sig_suspend, &act, NULL) != 0) {
ABORT("Cannot set SIG_SUSPEND handler");
}