Skip to content

Commit

Permalink
Align locking with master here. Fixes #5081.
Browse files Browse the repository at this point in the history
headius committed Mar 15, 2018

Verified

This commit was signed with the committer’s verified signature.
headius Charles Oliver Nutter
1 parent eeb2ced commit 8f7385d
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions core/src/main/java/org/jruby/util/io/OpenFile.java
Original file line number Diff line number Diff line change
@@ -2638,17 +2638,14 @@ public void addBlockingThread(RubyThread thread) {
* @param thread A thread blocking on this IO
*/
public void removeBlockingThread(RubyThread thread) {
boolean locked = lock();
try {
Set<RubyThread> blockingThreads = this.blockingThreads;
Set<RubyThread> blockingThreads = this.blockingThreads;

if (blockingThreads == null) {
return;
}
if (blockingThreads == null) {
return;
}

synchronized (blockingThreads) {
blockingThreads.remove(thread);
} finally {
if (locked) unlock();
}
}

0 comments on commit 8f7385d

Please sign in to comment.