Skip to content

Commit

Permalink
Make sure the thread is not in an interrupted state when cleanup up (f…
Browse files Browse the repository at this point in the history
…ixes jline#590)
  • Loading branch information
gnodet committed Oct 24, 2023
1 parent 7cbba19 commit 3500976
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,7 @@ && getLastBinding().charAt(0) == originalAttributes.getControlChar(ControlChar.V
throw e;
}
} finally {
boolean interrupted = Thread.interrupted();
try {
lock.lock();

Expand All @@ -784,6 +785,9 @@ && getLastBinding().charAt(0) == originalAttributes.getControlChar(ControlChar.V
} finally {
lock.unlock();
startedReading.set(false);
if (interrupted) {
Thread.currentThread().interrupt();
}
}
}
}
Expand Down

0 comments on commit 3500976

Please sign in to comment.