Thread#run does not work within signal handler
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:
Updated by ko1 (Koichi Sasada) about 7 years ago
- 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
$q.pop # wait for trap handler