Feature #7923

Queue#push and Queue#pop makes trap safe

Added by Motohiro KOSAKI about 1 year ago. Updated 7 months ago.

[ruby-core:52749]
Status:Closed
Priority:Normal
Assignee:Motohiro KOSAKI
Category:lib
Target version:next minor

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

History

#1 Updated by Koichi Sasada 7 months ago

  • Status changed from Assigned to Closed

Fixed by C-ext thread.

Also available in: Atom PDF