From: Mark Somerville Date: 2010-04-27T20:03:23+09:00 Subject: [ruby-core:29811] [Bug #3206] Problems manipulating the signal mask with Ruby Bug #3206: Problems manipulating the signal mask with Ruby http://redmine.ruby-lang.org/issues/show/3206 Author: Mark Somerville Status: Open, Priority: Normal Category: core ruby -v: 1.9.1 The futex timer thread inherits the (nearly empty) signal mask from the main thread when it is created. I've written a little Ruby library that executes sigprocmask/pthread_sigmask using FFI. However, my Ruby program isn't able to block signals since they are instead delivered to the timer thread. Also, calls to rb_enable_interrupt() unmask all signal types. Instead, I'd like Ruby to remember the signal mask I have set. The attached patch, against 1.9.1-p376, makes rb_disable_interrupt() save the old signal mask for rb_enable_interrupt() to use as well as masking all signals as soon as the timer thread is created. Finally, it removes the call to rb_trap_restore_mask() from rb_longjmp() - this appeared to be unnecessary. Is it? My testing hasn't shown any problems with this, but I'd love to hear any thoughts about this. ---------------------------------------- http://redmine.ruby-lang.org