Skip to content

Commit

Permalink
Prevent spurious unpark from causing deferred interrupt testing to fail
Browse files Browse the repository at this point in the history
  • Loading branch information
dmlloyd committed Sep 20, 2023
1 parent 9c98943 commit f595de3
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ public void testDeferral() throws Exception {
public void run() {
Thread.interrupted();
latch1.countDown();
// now wait
LockSupport.parkNanos(3000000000L);
if (! Thread.currentThread().isInterrupted()) {
// spurious unpark, perhaps
LockSupport.parkNanos(3000000000L);
}
delivered0.set(Thread.interrupted());
JBossThread.executeWithInterruptDeferred(new Runnable() {
public void run() {
Expand Down

0 comments on commit f595de3

Please sign in to comment.