Issue #6128 has been updated by Koichi Sasada.

Status changed from Open to Rejected

trap handler (registered block) run on main thread.  So Thread#run for main thread doesn't work.

You should use other ways to communicate trap handler and main thread, for example, Queue.

  $q = Queue.new
  trap(:INT){$q.push nil}
  
  ...
  $q.pop # wait for trap handler


----------------------------------------
Bug #6128: Thread#run does not work within signal handler
https://bugs.ruby-lang.org/issues/6128

Author: Mike Perham
Status: Rejected
Priority: Normal
Assignee: 
Category: 
Target version: 
ruby -v: ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin11.3.0]


If I stop Thread.main, calling Thread.main.run in a signal handler does not wake up the main thread.

Please see this gist with a simple reproducible example:
https://gist.github.com/2014773



-- 
http://bugs.ruby-lang.org/