From 455430acbabc2662520ba46e61d509d0ff42f281 Mon Sep 17 00:00:00 2001 From: ksss Date: Mon, 28 Sep 2026 22:03:59 +0900 Subject: [PATCH] Add `Thread.ignore_deadlock` --- core/thread.rbs | 31 +++++++++++++++++++++++++++++++ test/stdlib/Thread_test.rb | 4 ++++ 2 files changed, 35 insertions(+) diff --git a/core/thread.rbs b/core/thread.rbs index 59b2c6957..70b968035 100644 --- a/core/thread.rbs +++ b/core/thread.rbs @@ -169,6 +169,37 @@ class Thread < Object # def self.main: () -> Thread + # + # Returns the status of the global ``ignore deadlock'' condition. The default is + # `false`, so that deadlock conditions are not ignored. + # + # See also ::ignore_deadlock=. + # + def self.ignore_deadlock: () -> bool + + # + # Returns the new state. When set to `true`, the VM will not check for deadlock + # conditions. It is only useful to set this if your application can break a + # deadlock condition via some other means, such as a signal. + # + # Thread.ignore_deadlock = true + # queue = Thread::Queue.new + # + # trap(:SIGUSR1){queue.push "Received signal"} + # + # # raises fatal error unless ignoring deadlock + # puts queue.pop + # + # See also ::ignore_deadlock. + # + def self.ignore_deadlock=: (bool) -> bool + #