Project

General

Profile

Actions

Feature #3206

closed

Problems manipulating the signal mask with Ruby

Added by Spakman (Mark Somerville) about 15 years ago. Updated over 12 years ago.

Status:
Rejected
Target version:
-
[ruby-core:29811]

Description

=begin
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.
=end


Files

mask_signals_properly_ruby_191.patch (1.63 KB) mask_signals_properly_ruby_191.patch Spakman (Mark Somerville), 04/27/2010 08:03 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0