[ruby-core:60734] [ruby-trunk - Feature #7918] [Rejected] Create Signal.in_trap?()

From: akr@...
Date: 2014-02-14 10:18:56 UTC
List: ruby-core #60734
Issue #7918 has been updated by Akira Tanaka.

Status changed from Assigned to Rejected

Queue is a better solution now.
So we reject this issue.

----------------------------------------
Feature #7918: Create Signal.in_trap?()
https://bugs.ruby-lang.org/issues/7918#change-45155

* Author: Motohiro KOSAKI
* Status: Rejected
* Priority: Normal
* Assignee: Motohiro KOSAKI
* Category: core
* Target version: current: 2.2.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/

In This Thread

Prev Next