Project

General

Profile

Bug #12405

Updated by ko1 (Koichi Sasada) over 8 years ago

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 )

Back