From: nagachika00@... Date: 2017-03-27T15:49:06+00:00 Subject: [ruby-core:80391] [Ruby trunk Bug#12405] Queue doesn't work inside of trap Issue #12405 has been updated by nagachika (Tomoyuki Chikanaga). Backport changed from 2.1: UNKNOWN, 2.2: DONE, 2.3: REQUIRED, 2.4: DONE to 2.1: UNKNOWN, 2.2: DONE, 2.3: DONE, 2.4: DONE ruby_2_3 r58164 merged revision(s) 57492. ---------------------------------------- Bug #12405: Queue doesn't work inside of trap https://bugs.ruby-lang.org/issues/12405#change-63880 * Author: kirillrdy (Kirill Radzikhovskyy) * Status: Closed * Priority: Normal * Assignee: ko1 (Koichi Sasada) * Target version: * ruby -v: ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux] * Backport: 2.1: UNKNOWN, 2.2: DONE, 2.3: DONE, 2.4: DONE ---------------------------------------- when adding things to the queue inside that trap blocking pop never unblocks ``` q = Queue.new Signal.trap 'INT' do puts "got INT" q << 'something' end Thread.new { loop { sleep 1 Process.kill :INT, $$ } } q.pop ``` I know that there are limitations of what can be done inside of trap. Looking at this https://bugs.ruby-lang.org/issues/6128 it looks like I should be able to use Queue inside a trap, but code above runs forever. Also in jruby it behaives as expected ( at least in my understanding ) -- https://bugs.ruby-lang.org/ Unsubscribe: