Project

General

Profile

Actions

Feature #7918

closed

Create Signal.in_trap?()

Added by kosaki (Motohiro KOSAKI) about 11 years ago. Updated about 10 years ago.

Status:
Rejected
Target version:
[ruby-core:52727]

Description

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?

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0