From: Ivan Maidanski Date: Wed, 10 Jul 2013 08:19:09 +0000 (+0400) Subject: Check that SIG_SUSPEND and SIG_THR_RESTART are different (Pthreads) X-Git-Tag: gc7_4_0~59 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4c636aa96c80d80d0758d49a1ee67c4e6fe3f65f;p=gc 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). --- diff --git a/pthread_stop_world.c b/pthread_stop_world.c index 9d31c141..e633b0f6 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"); }