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

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

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines