summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRick Blommers <rick@blommersit.nl>2023-02-12 15:23:37 +0100
committergit <svn-admin@ruby-lang.org>2023-02-15 19:25:05 +0000
commit610375edfc2ed487dc5798278a5923154aec1c1f (patch)
tree64813ed48d90e6d56cf6e333eeb83a115800b9be /lib
parent8943b0d411519adeebd0d3dbf7cef337eed1ed02 (diff)
[ruby/timeout] Don't move the timer_thread when it's enclosed
Don't move the timer_thread to ThreadGroup::Default, when it's created in an enclosed ThreadGroup. Prevents the exception: "add" can't move from the enclosed thread group" https://github.com/ruby/timeout/commit/eb889d2c8b
Diffstat (limited to 'lib')
-rw-r--r--lib/timeout.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/timeout.rb b/lib/timeout.rb
index 7f40bafa4d..1d092f7c05 100644
--- a/lib/timeout.rb
+++ b/lib/timeout.rb
@@ -120,7 +120,7 @@ module Timeout
requests.reject!(&:done?)
end
end
- ThreadGroup::Default.add(watcher)
+ ThreadGroup::Default.add(watcher) unless watcher.group.enclosed?
watcher.name = "Timeout stdlib thread"
watcher.thread_variable_set(:"\0__detached_thread__", true)
watcher