From 4c7770b8d8739f8ca06dcf053072cec1709d76ed Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Thu, 14 Nov 2024 14:34:26 -0600 Subject: [PATCH] Don't clear the ThreadGroup when Thread terminates CRuby does not clear the ThreadGroup set in the Thread when the thread terminates. We do, which leads to some unpredictability in specs that check the group against a very short-lived thread. This patch removes the call to clear the thread's group. --- core/src/main/java/org/jruby/RubyThreadGroup.java | 1 - 1 file changed, 1 deletion(-) diff --git a/core/src/main/java/org/jruby/RubyThreadGroup.java b/core/src/main/java/org/jruby/RubyThreadGroup.java index 9518e013d41..e74e671cbdd 100644 --- a/core/src/main/java/org/jruby/RubyThreadGroup.java +++ b/core/src/main/java/org/jruby/RubyThreadGroup.java @@ -120,7 +120,6 @@ void addDirectly(RubyThread rubyThread) { public void remove(RubyThread rubyThread) { synchronized (rubyThread) { - rubyThread.setThreadGroup(null); rubyThreadList.remove(rubyThread); } }