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

Comparing jsr166/src/test/tck/AbstractQueuedSynchronizerTest.java (file contents):
Revision 1.41 by jsr166, Sat May 21 06:24:33 2011 UTC vs.
Revision 1.42 by jsr166, Fri Jun 3 05:07:14 2011 UTC

# Line 947 | Line 947 | public class AbstractQueuedSynchronizerT
947      }
948  
949      /**
950 <     * awaitUninterruptibly doesn't abort on interrupt
950 >     * awaitUninterruptibly is uninterruptible
951       */
952      public void testAwaitUninterruptibly() {
953          final Mutex sync = new Mutex();
954          final ConditionObject c = sync.newCondition();
955 <        final BooleanLatch acquired = new BooleanLatch();
955 >        final BooleanLatch pleaseInterrupt = new BooleanLatch();
956          Thread t = newStartedThread(new CheckedRunnable() {
957              public void realRun() {
958                  sync.acquire();
959 <                assertTrue(acquired.releaseShared(0));
959 >                assertTrue(pleaseInterrupt.releaseShared(0));
960                  c.awaitUninterruptibly();
961                  assertTrue(Thread.interrupted());
962                  assertHasWaitersLocked(sync, c, NO_THREADS);
963                  sync.release();
964              }});
965  
966 <        acquired.acquireShared(0);
966 >        pleaseInterrupt.acquireShared(0);
967          sync.acquire();
968          assertHasWaitersLocked(sync, c, t);
969          sync.release();
# Line 990 | Line 990 | public class AbstractQueuedSynchronizerT
990      public void testInterruptible(final AwaitMethod awaitMethod) {
991          final Mutex sync = new Mutex();
992          final ConditionObject c = sync.newCondition();
993 <        final BooleanLatch acquired = new BooleanLatch();
993 >        final BooleanLatch pleaseInterrupt = new BooleanLatch();
994          Thread t = newStartedThread(new CheckedInterruptedRunnable() {
995              public void realRun() throws InterruptedException {
996                  sync.acquire();
997 <                assertTrue(acquired.releaseShared(0));
997 >                assertTrue(pleaseInterrupt.releaseShared(0));
998                  await(c, awaitMethod);
999              }});
1000  
1001 <        acquired.acquireShared(0);
1001 >        pleaseInterrupt.acquireShared(0);
1002          t.interrupt();
1003          awaitTermination(t);
1004      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines