Project

General

Profile

Misc #14901 ยป 0001-do-not-block-SIGCHLD-in-normal-Ruby-Threads.patch

normalperson (Eric Wong), 07/08/2018 02:53 AM

View differences:

process.c
3826 3826
	}
3827 3827
    }
3828 3828

  
3829
    /* non-Ruby child process, ensure cmake can see SIGCHLD */
3830
    sigemptyset(&old->sigmask);
3831 3829
    ret = sigprocmask(SIG_SETMASK, &old->sigmask, NULL); /* async-signal-safe */
3832 3830
    if (ret != 0) {
3833 3831
        ERRMSG("sigprocmask");
signal.c
764 764
#ifdef HAVE_PTHREAD_SIGMASK
765 765
    sigset_t mask;
766 766
    sigemptyset(&mask);
767
    sigaddset(&mask, RUBY_SIGCHLD); /* timer-thread handles this */
768 767
    pthread_sigmask(SIG_SETMASK, &mask, NULL);
769 768
#endif
770 769
}
thread_pthread.c
1494 1494
thread_timer(void *p)
1495 1495
{
1496 1496
    rb_vm_t *vm = p;
1497
#ifdef HAVE_PTHREAD_SIGMASK /* mainly to enable SIGCHLD */
1498
    {
1499
        sigset_t mask;
1500
        sigemptyset(&mask);
1501
        pthread_sigmask(SIG_SETMASK, &mask, NULL);
1502
    }
1503
#endif
1504 1497

  
1505 1498
    if (TT_DEBUG) WRITE_CONST(2, "start timer thread\n");
1506 1499

  
1507
-