]> granicus.if.org Git - gc/commitdiff
Check that SIG_SUSPEND and SIG_THR_RESTART are different (Pthreads)
authorIvan Maidanski <ivmai@mail.ru>
Wed, 10 Jul 2013 08:19:09 +0000 (12:19 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 10 Jul 2013 08:19:09 +0000 (12:19 +0400)
* 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).

pthread_stop_world.c

index 9d31c1410319eb7750b43b0457c43ddb16cae20d..e633b0f61db652fc2c7a3da30ef224d1906d7b8b 100644 (file)
@@ -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");
     }