(fix commit '
05daaee')
* os_dep.c (GC_dirty_init): Pass SIG_SUSPEND instead of
GC_get_suspend_signal() to sigaddset() if no THREADS (or if
GC_OPENBSD_THREADS, or GC_WIN32_THREADS or NACL).
* pthread_support.c (pthread_sigmask): Assert GC_get_suspend_signal()
does not return -1 (only if not GC_NO_PTHREAD_SIGMASK).
/* Arrange to postpone the signal while we are in a write fault */
/* handler. This effectively makes the handler atomic w.r.t. */
/* stopping the world for GC. */
- (void)sigaddset(&act.sa_mask, GC_get_suspend_signal());
+# if defined(THREADS) && !defined(GC_OPENBSD_THREADS) \
+ && !defined(GC_WIN32_THREADS) && !defined(NACL)
+ (void)sigaddset(&act.sa_mask, GC_get_suspend_signal());
+# else
+ (void)sigaddset(&act.sa_mask, SIG_SUSPEND);
+# endif
# endif
# endif
if (GC_print_stats == VERBOSE)
sigset_t *oset)
{
sigset_t fudged_set;
+ int sig_suspend;
INIT_REAL_SYMS();
if (set != NULL && (how == SIG_BLOCK || how == SIG_SETMASK)) {
fudged_set = *set;
- sigdelset(&fudged_set, GC_get_suspend_signal());
+ sig_suspend = GC_get_suspend_signal();
+ GC_ASSERT(sig_suspend >= 0);
+ sigdelset(&fudged_set, sig_suspend);
set = &fudged_set;
}
return(REAL_FUNC(pthread_sigmask)(how, set, oset));