Skip to content

Commit

Permalink
Eliminate deadlock when waiting for blocking threads.
Browse files Browse the repository at this point in the history
I am not sure why this is not needed on master, but it fixes the
deadlock in CI right now on 9.1.
headius committed Dec 22, 2017
1 parent 1fd8a50 commit 1eaf339
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/src/main/java/org/jruby/RubyIO.java
Original file line number Diff line number Diff line change
@@ -2036,7 +2036,12 @@ protected IRubyObject rbIoClose(Ruby runtime) {

// interrupt waiting threads
fptr.interruptBlockingThreads(context);
fptr.waitForBlockingThreads(context);
try {
fptr.unlock();
fptr.waitForBlockingThreads(context);
} finally {
fptr.lock();
}
fptr.cleanup(runtime, false);

if (fptr.getProcess() != null) {

0 comments on commit 1eaf339

Please sign in to comment.