From: KOSAKI Motohiro Date: 2013-02-26T07:08:11+09:00 Subject: [ruby-core:52898] Re: [ruby-trunk - Feature #7918][Open] Create Signal.in_trap?() On Sun, Feb 24, 2013 at 1:15 PM, SASADA Koichi wrote: > (2013/02/23 11:31), kosaki (Motohiro KOSAKI) wrote: >> Currently, ruby library have no way to detect a method is called from trap handler or not. >> This is useful because Mutex#lock under trap raises an exception and some libraries may want to avoid it. > > I'm not sure why it is useful. If a lock is needed, then the lock should > be acquired in trap handler (and not supported yet). Detecting it is in > trap, and do what? The most obvious usecase is to improve better error handling and better error messages. And yes, we need several further steps. e.g. masking trap.