Issue #12405 has been updated by Koichi Sasada.

Description updated
Assignee set to Koichi Sasada

----------------------------------------
Bug #12405: Queue doesn't work inside of trap
https://bugs.ruby-lang.org/issues/12405#change-58867

* Author: Kirill Radzikhovskyy
* Status: Open
* Priority: Normal
* Assignee: Koichi Sasada
* ruby -v: ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
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: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>