ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/LockSupportTest.java
(Generate patch)

Comparing jsr166/src/test/tck/LockSupportTest.java (file contents):
Revision 1.29 by jsr166, Fri May 12 18:48:11 2017 UTC vs.
Revision 1.30 by jsr166, Fri May 12 18:57:11 2017 UTC

# Line 223 | Line 223 | public class LockSupportTest extends JSR
223      }
224      public void testParkAfterInterrupt(final ParkMethod parkMethod) {
225          final CountDownLatch pleaseInterrupt = new CountDownLatch(1);
226        final AtomicBoolean pleasePark = new AtomicBoolean(false);
226          Thread t = newStartedThread(new CheckedRunnable() {
227              public void realRun() throws Exception {
228                  pleaseInterrupt.countDown();
229 <                while (!pleasePark.get())
229 >                while (!Thread.currentThread().isInterrupted())
230                      Thread.yield();
232                assertTrue(Thread.currentThread().isInterrupted());
231                  parkMethod.park();
232 <                assertTrue(Thread.currentThread().isInterrupted());
232 >                assertTrue(Thread.interrupted());
233              }});
234  
235          await(pleaseInterrupt);
236          t.interrupt();
239        pleasePark.set(true);
237          awaitTermination(t);
238      }
239  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines