aboutsummaryrefslogtreecommitdiffstats
path: root/signal.c
diff options
context:
space:
mode:
Diffstat (limited to 'signal.c')
-rw-r--r--signal.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/signal.c b/signal.c
index 65b45cf6bd..6393273adf 100644
--- a/signal.c
+++ b/signal.c
@@ -709,6 +709,9 @@ signal_enque(int sig)
static rb_atomic_t sigchld_hit;
+/* Prevent compiler from reordering access */
+#define ACCESS_ONCE(type,x) (*((volatile type *)&(x)))
+
static RETSIGTYPE
sighandler(int sig)
{
@@ -727,7 +730,7 @@ sighandler(int sig)
else {
signal_enque(sig);
}
- rb_thread_wakeup_timer_thread(sig);
+ rb_thread_wakeup_timer_thread();
#if !defined(BSD_SIGNAL) && !defined(POSIX_SIGNAL)
ruby_signal(sig, sighandler);
#endif
@@ -761,6 +764,7 @@ rb_enable_interrupt(void)
#ifdef HAVE_PTHREAD_SIGMASK
sigset_t mask;
sigemptyset(&mask);
+ sigaddset(&mask, RUBY_SIGCHLD); /* timer-thread handles this */
pthread_sigmask(SIG_SETMASK, &mask, NULL);
#endif
}
@@ -1073,6 +1077,7 @@ rb_trap_exit(void)
void ruby_waitpid_all(rb_vm_t *); /* process.c */
+/* only runs in the timer-thread */
void
ruby_sigchld_handler(rb_vm_t *vm)
{