Skip to content

Commit

Permalink
Merge pull request #2451 from Who828/sync_thread_group_fix
Browse files Browse the repository at this point in the history
No need to synchronise a newly created local RubyArray
  • Loading branch information
headius committed Jan 12, 2015
1 parent 01f3945 commit d99bfd9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/main/java/org/jruby/RubyThreadGroup.java
Expand Up @@ -145,14 +145,14 @@ public IRubyObject enclosed_p(Block block) {
@JRubyMethod
public IRubyObject list(Block block) {
RubyArray ary = RubyArray.newArray(getRuntime());
synchronized (ary) {
synchronized (rubyThreadList) {
for (RubyThread thread : rubyThreadList) {
if (thread != null) {
ary.append(thread);
}
}
return ary;
}
return ary;
}

private RubyThreadGroup(Ruby runtime, RubyClass type) {
Expand Down

0 comments on commit d99bfd9

Please sign in to comment.