From: "kosaki (Motohiro KOSAKI)" Date: 2013-08-31T02:16:48+09:00 Subject: [ruby-core:56888] [ruby-trunk - Feature #7918][Assigned] Create Signal.in_trap?() Issue #7918 has been updated by kosaki (Motohiro KOSAKI). Status changed from Open to Assigned Assignee set to kosaki (Motohiro KOSAKI) ---------------------------------------- Feature #7918: Create Signal.in_trap?() https://bugs.ruby-lang.org/issues/7918#change-41436 Author: kosaki (Motohiro KOSAKI) Status: Assigned Priority: Normal Assignee: kosaki (Motohiro KOSAKI) Category: core Target version: current: 2.1.0 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. Then, I would like to create Signal.in_trap?() class method. Signal.in_trap?(signal = nil) return true when running trap handler. return false otherwise. When signal argument is specified, return true only when running trap of specified signal. Thought? -- http://bugs.ruby-lang.org/