5ab08c608b
This uses a thread-local queue and a self-pipe so the code in the trap blocks is properly re-entrant. For details, see: * http://cr.yp.to/docs/selfpipe.html * http://blog.rubybestpractices.com/posts/ewong/016-Implementing-Signal-Handlers.html