Skip to content

Commit 8f7385d

Browse files
committedMar 15, 2018
Align locking with master here. Fixes #5081.
1 parent eeb2ced commit 8f7385d

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed
 

Diff for: ‎core/src/main/java/org/jruby/util/io/OpenFile.java

+5-8
Original file line numberDiff line numberDiff line change
@@ -2638,17 +2638,14 @@ public void addBlockingThread(RubyThread thread) {
26382638
* @param thread A thread blocking on this IO
26392639
*/
26402640
public void removeBlockingThread(RubyThread thread) {
2641-
boolean locked = lock();
2642-
try {
2643-
Set<RubyThread> blockingThreads = this.blockingThreads;
2641+
Set<RubyThread> blockingThreads = this.blockingThreads;
26442642

2645-
if (blockingThreads == null) {
2646-
return;
2647-
}
2643+
if (blockingThreads == null) {
2644+
return;
2645+
}
26482646

2647+
synchronized (blockingThreads) {
26492648
blockingThreads.remove(thread);
2650-
} finally {
2651-
if (locked) unlock();
26522649
}
26532650
}
26542651

0 commit comments

Comments
 (0)