Skip to content

Commit

Permalink
Showing 3 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -70,7 +70,7 @@ public static DynamicObject createRubyThread(RubyContext context) {
null,
new AtomicBoolean(false),
0,
null);
context.getCoreLibrary().getNilObject());

Layouts.THREAD.setFiberManagerUnsafe(object, new FiberManager(context, object)); // Because it is cyclic

Original file line number Diff line number Diff line change
@@ -118,13 +118,9 @@ public abstract static class GroupNode extends CoreMethodArrayArgumentsNode {

@Specialization
public DynamicObject group(DynamicObject thread) {
final DynamicObject group = Layouts.THREAD.getThreadGroup(thread);
if (group == null) {
return nil();
} else {
return group;
}
return Layouts.THREAD.getThreadGroup(thread);
}

}

@CoreMethod(names = { "kill", "exit", "terminate" }, unsafe = UnsafeGroup.THREADS)
2 changes: 1 addition & 1 deletion truffle/src/main/ruby/core/thread.rb
Original file line number Diff line number Diff line change
@@ -378,7 +378,7 @@ def add(thread)
end

def list
Thread.list.find_all { |th| th.group == self }
Thread.list.select { |th| th.group == self }
end

Default = ThreadGroup.new

0 comments on commit bd9a45a

Please sign in to comment.