Project

General

Profile

Actions

Feature #7923

closed

Queue#push and Queue#pop makes trap safe

Added by kosaki (Motohiro KOSAKI) almost 12 years ago. Updated about 11 years ago.

Status:
Closed
Target version:
[ruby-core:52749]

Description

Currently, following program don't work because q.push raises an exception.
However, it would be nice if queue is trap safe and Queue#push and Queue#pop can be called from trap handler.


require "thread"

q = Queue.new

trap("USR1") {
q.push(nil)
}

Process.kill :USR1, $$
sleep

Actions

Also available in: Atom PDF

Like0
Like0