This project is closed and read-only.
Backport #3779 ยป 100901_threading_fixes.patch
| process.c | ||
|---|---|---|
|
before_exec();
|
||
|
pid = fork();
|
||
|
after_exec();
|
||
|
if (pid != 0)
|
||
|
after_exec();
|
||
|
switch (pid) {
|
||
|
case 0:
|
||
|
#ifdef linux
|
||
|
after_exec();
|
||
|
#endif
|
||
|
rb_thread_atfork();
|
||
|
if (rb_block_given_p()) {
|
||
|
int status;
|
||
|
-- a/signal.c
|
||
|
++ b/signal.c
|
||
| ... | ... | |
|
# ifdef HAVE_SIGPROCMASK
|
||
|
sigfillset(&mask);
|
||
|
sigprocmask(SIG_BLOCK, &mask, &old_mask);
|
||
|
pthread_sigmask(SIG_BLOCK, &mask, &old_mask);
|
||
|
# else
|
||
|
mask = sigblock(~0);
|
||
|
sigsetmask(mask);
|
||
| ... | ... | |
|
{
|
||
|
/* enable interrupt */
|
||
|
#ifdef HAVE_SIGPROCMASK
|
||
|
sigprocmask(SIG_SETMASK, &arg->mask, NULL);
|
||
|
pthread_sigmask(SIG_SETMASK, &arg->mask, NULL);
|
||
|
#else
|
||
|
sigsetmask(arg->mask);
|
||
|
#endif
|
||
| ... | ... | |
|
{
|
||
|
#if USE_TRAP_MASK
|
||
|
# ifdef HAVE_SIGPROCMASK
|
||
|
sigprocmask(SIG_SETMASK, &trap_last_mask, NULL);
|
||
|
pthread_sigmask(SIG_SETMASK, &trap_last_mask, NULL);
|
||
|
# else
|
||
|
sigsetmask(trap_last_mask);
|
||
|
# endif
|
||
| ... | ... | |
|
/* disable interrupt */
|
||
|
# ifdef HAVE_SIGPROCMASK
|
||
|
sigfillset(&arg.mask);
|
||
|
sigprocmask(SIG_BLOCK, &arg.mask, &arg.mask);
|
||
|
pthread_sigmask(SIG_BLOCK, &arg.mask, &arg.mask);
|
||
|
# else
|
||
|
arg.mask = sigblock(~0);
|
||
|
# endif
|
||
| ... | ... | |
|
/* disable interrupt */
|
||
|
# ifdef HAVE_SIGPROCMASK
|
||
|
sigfillset(&mask);
|
||
|
sigprocmask(SIG_BLOCK, &mask, &mask);
|
||
|
pthread_sigmask(SIG_BLOCK, &mask, &mask);
|
||
|
# else
|
||
|
mask = sigblock(~0);
|
||
|
# endif
|
||
| ... | ... | |
|
#if USE_TRAP_MASK
|
||
|
#ifdef HAVE_SIGPROCMASK
|
||
|
sigdelset(&mask, sig);
|
||
|
sigprocmask(SIG_SETMASK, &mask, NULL);
|
||
|
pthread_sigmask(SIG_SETMASK, &mask, NULL);
|
||
|
#else
|
||
|
mask &= ~sigmask(sig);
|
||
|
sigsetmask(mask);
|
||