diff options
author | Rick Blommers <[email protected]> | 2023-02-12 15:23:37 +0100 |
---|---|---|
committer | git <[email protected]> | 2023-02-15 19:25:05 +0000 |
commit | 610375edfc2ed487dc5798278a5923154aec1c1f (patch) | |
tree | 64813ed48d90e6d56cf6e333eeb83a115800b9be /lib/timeout.rb | |
parent | 8943b0d411519adeebd0d3dbf7cef337eed1ed02 (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/timeout.rb')
-rw-r--r-- | lib/timeout.rb | 2 |
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 |