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.10 by jsr166, Wed Nov 18 16:04:34 2009 UTC vs.
Revision 1.11 by jsr166, Sat Nov 21 02:07:26 2009 UTC

# Line 96 | Line 96 | public class AbstractQueuedLongSynchroni
96       * isHeldExclusively is false upon construction
97       */
98      public void testIsHeldExclusively() {
99 <        Mutex rl = new Mutex();
99 >        Mutex rl = new Mutex();
100          assertFalse(rl.isHeldExclusively());
101      }
102  
# Line 104 | Line 104 | public class AbstractQueuedLongSynchroni
104       * acquiring released sync succeeds
105       */
106      public void testAcquire() {
107 <        Mutex rl = new Mutex();
107 >        Mutex rl = new Mutex();
108          rl.acquire(1);
109          assertTrue(rl.isHeldExclusively());
110          rl.release(1);
# Line 115 | Line 115 | public class AbstractQueuedLongSynchroni
115       * tryAcquire on an released sync succeeds
116       */
117      public void testTryAcquire() {
118 <        Mutex rl = new Mutex();
118 >        Mutex rl = new Mutex();
119          assertTrue(rl.tryAcquire(1));
120          assertTrue(rl.isHeldExclusively());
121          rl.release(1);
# Line 125 | Line 125 | public class AbstractQueuedLongSynchroni
125       * hasQueuedThreads reports whether there are waiting threads
126       */
127      public void testhasQueuedThreads() throws InterruptedException {
128 <        final Mutex sync = new Mutex();
128 >        final Mutex sync = new Mutex();
129          Thread t1 = new Thread(new InterruptedSyncRunnable(sync));
130          Thread t2 = new Thread(new InterruptibleSyncRunnable(sync));
131          assertFalse(sync.hasQueuedThreads());
# Line 150 | Line 150 | public class AbstractQueuedLongSynchroni
150       * isQueued(null) throws NPE
151       */
152      public void testIsQueuedNPE() {
153 <        final Mutex sync = new Mutex();
153 >        final Mutex sync = new Mutex();
154          try {
155              sync.isQueued(null);
156              shouldThrow();
# Line 161 | Line 161 | public class AbstractQueuedLongSynchroni
161       * isQueued reports whether a thread is queued.
162       */
163      public void testIsQueued() throws InterruptedException {
164 <        final Mutex sync = new Mutex();
164 >        final Mutex sync = new Mutex();
165          Thread t1 = new Thread(new InterruptedSyncRunnable(sync));
166          Thread t2 = new Thread(new InterruptibleSyncRunnable(sync));
167          assertFalse(sync.isQueued(t1));
# Line 191 | Line 191 | public class AbstractQueuedLongSynchroni
191       * getFirstQueuedThread returns first waiting thread or null if none
192       */
193      public void testGetFirstQueuedThread() throws InterruptedException {
194 <        final Mutex sync = new Mutex();
194 >        final Mutex sync = new Mutex();
195          Thread t1 = new Thread(new InterruptedSyncRunnable(sync));
196          Thread t2 = new Thread(new InterruptibleSyncRunnable(sync));
197          assertNull(sync.getFirstQueuedThread());
# Line 218 | Line 218 | public class AbstractQueuedLongSynchroni
218       * hasContended reports false if no thread has ever blocked, else true
219       */
220      public void testHasContended() throws InterruptedException {
221 <        final Mutex sync = new Mutex();
221 >        final Mutex sync = new Mutex();
222          Thread t1 = new Thread(new InterruptedSyncRunnable(sync));
223          Thread t2 = new Thread(new InterruptibleSyncRunnable(sync));
224          assertFalse(sync.hasContended());
# Line 243 | Line 243 | public class AbstractQueuedLongSynchroni
243       * getQueuedThreads includes waiting threads
244       */
245      public void testGetQueuedThreads() throws InterruptedException {
246 <        final Mutex sync = new Mutex();
246 >        final Mutex sync = new Mutex();
247          Thread t1 = new Thread(new InterruptedSyncRunnable(sync));
248          Thread t2 = new Thread(new InterruptibleSyncRunnable(sync));
249          assertTrue(sync.getQueuedThreads().isEmpty());
# Line 271 | Line 271 | public class AbstractQueuedLongSynchroni
271       * getExclusiveQueuedThreads includes waiting threads
272       */
273      public void testGetExclusiveQueuedThreads() throws InterruptedException {
274 <        final Mutex sync = new Mutex();
274 >        final Mutex sync = new Mutex();
275          Thread t1 = new Thread(new InterruptedSyncRunnable(sync));
276          Thread t2 = new Thread(new InterruptibleSyncRunnable(sync));
277          assertTrue(sync.getExclusiveQueuedThreads().isEmpty());
# Line 299 | Line 299 | public class AbstractQueuedLongSynchroni
299       * getSharedQueuedThreads does not include exclusively waiting threads
300       */
301      public void testGetSharedQueuedThreads() throws InterruptedException {
302 <        final Mutex sync = new Mutex();
302 >        final Mutex sync = new Mutex();
303          Thread t1 = new Thread(new InterruptedSyncRunnable(sync));
304          Thread t2 = new Thread(new InterruptibleSyncRunnable(sync));
305          assertTrue(sync.getSharedQueuedThreads().isEmpty());
# Line 325 | Line 325 | public class AbstractQueuedLongSynchroni
325       * tryAcquireNanos is interruptible.
326       */
327      public void testInterruptedException2() throws InterruptedException {
328 <        final Mutex sync = new Mutex();
329 <        sync.acquire(1);
330 <        Thread t = new Thread(new CheckedInterruptedRunnable() {
328 >        final Mutex sync = new Mutex();
329 >        sync.acquire(1);
330 >        Thread t = new Thread(new CheckedInterruptedRunnable() {
331              public void realRun() throws InterruptedException {
332                  sync.tryAcquireNanos(1, MEDIUM_DELAY_MS * 1000 * 1000);
333              }});
# Line 342 | Line 342 | public class AbstractQueuedLongSynchroni
342       * TryAcquire on exclusively held sync fails
343       */
344      public void testTryAcquireWhenSynced() throws InterruptedException {
345 <        final Mutex sync = new Mutex();
346 <        sync.acquire(1);
347 <        Thread t = new Thread(new CheckedRunnable() {
345 >        final Mutex sync = new Mutex();
346 >        sync.acquire(1);
347 >        Thread t = new Thread(new CheckedRunnable() {
348              public void realRun() {
349                  threadAssertFalse(sync.tryAcquire(1));
350              }});
# Line 358 | Line 358 | public class AbstractQueuedLongSynchroni
358       * tryAcquireNanos on an exclusively held sync times out
359       */
360      public void testAcquireNanos_Timeout() throws InterruptedException {
361 <        final Mutex sync = new Mutex();
362 <        sync.acquire(1);
363 <        Thread t = new Thread(new CheckedRunnable() {
361 >        final Mutex sync = new Mutex();
362 >        sync.acquire(1);
363 >        Thread t = new Thread(new CheckedRunnable() {
364              public void realRun() throws InterruptedException {
365                  threadAssertFalse(sync.tryAcquireNanos(1, 1000 * 1000));
366              }});
# Line 375 | Line 375 | public class AbstractQueuedLongSynchroni
375       * getState is true when acquired and false when not
376       */
377      public void testGetState() throws InterruptedException {
378 <        final Mutex sync = new Mutex();
379 <        sync.acquire(1);
380 <        assertTrue(sync.isHeldExclusively());
381 <        sync.release(1);
382 <        assertFalse(sync.isHeldExclusively());
383 <        Thread t = new Thread(new CheckedRunnable() {
378 >        final Mutex sync = new Mutex();
379 >        sync.acquire(1);
380 >        assertTrue(sync.isHeldExclusively());
381 >        sync.release(1);
382 >        assertFalse(sync.isHeldExclusively());
383 >        Thread t = new Thread(new CheckedRunnable() {
384              public void realRun() throws InterruptedException {
385                  sync.acquire(1);
386                  Thread.sleep(SMALL_DELAY_MS);
# Line 399 | Line 399 | public class AbstractQueuedLongSynchroni
399       * acquireInterruptibly is interruptible.
400       */
401      public void testAcquireInterruptibly1() throws InterruptedException {
402 <        final Mutex sync = new Mutex();
403 <        sync.acquire(1);
404 <        Thread t = new Thread(new InterruptedSyncRunnable(sync));
402 >        final Mutex sync = new Mutex();
403 >        sync.acquire(1);
404 >        Thread t = new Thread(new InterruptedSyncRunnable(sync));
405          t.start();
406          Thread.sleep(SHORT_DELAY_MS);
407          t.interrupt();
# Line 414 | Line 414 | public class AbstractQueuedLongSynchroni
414       * acquireInterruptibly succeeds when released, else is interruptible
415       */
416      public void testAcquireInterruptibly2() throws InterruptedException {
417 <        final Mutex sync = new Mutex();
417 >        final Mutex sync = new Mutex();
418          sync.acquireInterruptibly(1);
419 <        Thread t = new Thread(new InterruptedSyncRunnable(sync));
419 >        Thread t = new Thread(new InterruptedSyncRunnable(sync));
420          t.start();
421          t.interrupt();
422          assertTrue(sync.isHeldExclusively());
# Line 427 | Line 427 | public class AbstractQueuedLongSynchroni
427       * owns is true for a condition created by sync else false
428       */
429      public void testOwns() {
430 <        final Mutex sync = new Mutex();
430 >        final Mutex sync = new Mutex();
431          final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
432          final Mutex sync2 = new Mutex();
433          assertTrue(sync.owns(c));
# Line 438 | Line 438 | public class AbstractQueuedLongSynchroni
438       * Calling await without holding sync throws IllegalMonitorStateException
439       */
440      public void testAwait_IllegalMonitor() throws InterruptedException {
441 <        final Mutex sync = new Mutex();
441 >        final Mutex sync = new Mutex();
442          final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
443          try {
444              c.await();
# Line 450 | Line 450 | public class AbstractQueuedLongSynchroni
450       * Calling signal without holding sync throws IllegalMonitorStateException
451       */
452      public void testSignal_IllegalMonitor() throws InterruptedException {
453 <        final Mutex sync = new Mutex();
453 >        final Mutex sync = new Mutex();
454          final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
455          try {
456              c.signal();
# Line 462 | Line 462 | public class AbstractQueuedLongSynchroni
462       * awaitNanos without a signal times out
463       */
464      public void testAwaitNanos_Timeout() throws InterruptedException {
465 <        final Mutex sync = new Mutex();
465 >        final Mutex sync = new Mutex();
466          final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
467          sync.acquire(1);
468          long t = c.awaitNanos(100);
# Line 474 | Line 474 | public class AbstractQueuedLongSynchroni
474       *  Timed await without a signal times out
475       */
476      public void testAwait_Timeout() throws InterruptedException {
477 <        final Mutex sync = new Mutex();
477 >        final Mutex sync = new Mutex();
478          final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
479          sync.acquire(1);
480          assertFalse(c.await(SHORT_DELAY_MS, TimeUnit.MILLISECONDS));
# Line 485 | Line 485 | public class AbstractQueuedLongSynchroni
485       * awaitUntil without a signal times out
486       */
487      public void testAwaitUntil_Timeout() throws InterruptedException {
488 <        final Mutex sync = new Mutex();
488 >        final Mutex sync = new Mutex();
489          final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
490          sync.acquire(1);
491          java.util.Date d = new java.util.Date();
# Line 497 | Line 497 | public class AbstractQueuedLongSynchroni
497       * await returns when signalled
498       */
499      public void testAwait() throws InterruptedException {
500 <        final Mutex sync = new Mutex();
500 >        final Mutex sync = new Mutex();
501          final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
502 <        Thread t = new Thread(new CheckedRunnable() {
502 >        Thread t = new Thread(new CheckedRunnable() {
503              public void realRun() throws InterruptedException {
504                  sync.acquire(1);
505                  c.await();
# Line 521 | Line 521 | public class AbstractQueuedLongSynchroni
521       * hasWaiters throws NPE if null
522       */
523      public void testHasWaitersNPE() {
524 <        final Mutex sync = new Mutex();
524 >        final Mutex sync = new Mutex();
525          try {
526              sync.hasWaiters(null);
527              shouldThrow();
# Line 532 | Line 532 | public class AbstractQueuedLongSynchroni
532       * getWaitQueueLength throws NPE if null
533       */
534      public void testGetWaitQueueLengthNPE() {
535 <        final Mutex sync = new Mutex();
535 >        final Mutex sync = new Mutex();
536          try {
537              sync.getWaitQueueLength(null);
538              shouldThrow();
# Line 544 | Line 544 | public class AbstractQueuedLongSynchroni
544       * getWaitingThreads throws NPE if null
545       */
546      public void testGetWaitingThreadsNPE() {
547 <        final Mutex sync = new Mutex();
547 >        final Mutex sync = new Mutex();
548          try {
549              sync.getWaitingThreads(null);
550              shouldThrow();
# Line 556 | Line 556 | public class AbstractQueuedLongSynchroni
556       * hasWaiters throws IAE if not owned
557       */
558      public void testHasWaitersIAE() {
559 <        final Mutex sync = new Mutex();
559 >        final Mutex sync = new Mutex();
560          final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
561 <        final Mutex sync2 = new Mutex();
561 >        final Mutex sync2 = new Mutex();
562          try {
563              sync2.hasWaiters(c);
564              shouldThrow();
# Line 569 | Line 569 | public class AbstractQueuedLongSynchroni
569       * hasWaiters throws IMSE if not synced
570       */
571      public void testHasWaitersIMSE() {
572 <        final Mutex sync = new Mutex();
572 >        final Mutex sync = new Mutex();
573          final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
574          try {
575              sync.hasWaiters(c);
# Line 582 | Line 582 | public class AbstractQueuedLongSynchroni
582       * getWaitQueueLength throws IAE if not owned
583       */
584      public void testGetWaitQueueLengthIAE() {
585 <        final Mutex sync = new Mutex();
585 >        final Mutex sync = new Mutex();
586          final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
587 <        final Mutex sync2 = new Mutex();
587 >        final Mutex sync2 = new Mutex();
588          try {
589              sync2.getWaitQueueLength(c);
590              shouldThrow();
# Line 595 | Line 595 | public class AbstractQueuedLongSynchroni
595       * getWaitQueueLength throws IMSE if not synced
596       */
597      public void testGetWaitQueueLengthIMSE() {
598 <        final Mutex sync = new Mutex();
598 >        final Mutex sync = new Mutex();
599          final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
600          try {
601              sync.getWaitQueueLength(c);
# Line 608 | Line 608 | public class AbstractQueuedLongSynchroni
608       * getWaitingThreads throws IAE if not owned
609       */
610      public void testGetWaitingThreadsIAE() {
611 <        final Mutex sync = new Mutex();
611 >        final Mutex sync = new Mutex();
612          final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
613 <        final Mutex sync2 = new Mutex();
613 >        final Mutex sync2 = new Mutex();
614          try {
615              sync2.getWaitingThreads(c);
616              shouldThrow();
# Line 621 | Line 621 | public class AbstractQueuedLongSynchroni
621       * getWaitingThreads throws IMSE if not synced
622       */
623      public void testGetWaitingThreadsIMSE() {
624 <        final Mutex sync = new Mutex();
624 >        final Mutex sync = new Mutex();
625          final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
626          try {
627              sync.getWaitingThreads(c);
# Line 635 | Line 635 | public class AbstractQueuedLongSynchroni
635       * hasWaiters returns true when a thread is waiting, else false
636       */
637      public void testHasWaiters() throws InterruptedException {
638 <        final Mutex sync = new Mutex();
638 >        final Mutex sync = new Mutex();
639          final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
640 <        Thread t = new Thread(new CheckedRunnable() {
640 >        Thread t = new Thread(new CheckedRunnable() {
641              public void realRun() throws InterruptedException {
642                  sync.acquire(1);
643                  threadAssertFalse(sync.hasWaiters(c));
# Line 666 | Line 666 | public class AbstractQueuedLongSynchroni
666       * getWaitQueueLength returns number of waiting threads
667       */
668      public void testGetWaitQueueLength() throws InterruptedException {
669 <        final Mutex sync = new Mutex();
669 >        final Mutex sync = new Mutex();
670          final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
671 <        Thread t1 = new Thread(new CheckedRunnable() {
671 >        Thread t1 = new Thread(new CheckedRunnable() {
672              public void realRun() throws InterruptedException {
673                  sync.acquire(1);
674                  threadAssertFalse(sync.hasWaiters(c));
# Line 677 | Line 677 | public class AbstractQueuedLongSynchroni
677                  sync.release(1);
678              }});
679  
680 <        Thread t2 = new Thread(new CheckedRunnable() {
680 >        Thread t2 = new Thread(new CheckedRunnable() {
681              public void realRun() throws InterruptedException {
682                  sync.acquire(1);
683                  threadAssertTrue(sync.hasWaiters(c));
# Line 710 | Line 710 | public class AbstractQueuedLongSynchroni
710       * getWaitingThreads returns only and all waiting threads
711       */
712      public void testGetWaitingThreads() throws InterruptedException {
713 <        final Mutex sync = new Mutex();
713 >        final Mutex sync = new Mutex();
714          final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
715 <        Thread t1 = new Thread(new CheckedRunnable() {
715 >        Thread t1 = new Thread(new CheckedRunnable() {
716              public void realRun() throws InterruptedException {
717                  sync.acquire(1);
718                  threadAssertTrue(sync.getWaitingThreads(c).isEmpty());
# Line 720 | Line 720 | public class AbstractQueuedLongSynchroni
720                  sync.release(1);
721              }});
722  
723 <        Thread t2 = new Thread(new CheckedRunnable() {
723 >        Thread t2 = new Thread(new CheckedRunnable() {
724              public void realRun() throws InterruptedException {
725                  sync.acquire(1);
726                  threadAssertFalse(sync.getWaitingThreads(c).isEmpty());
# Line 758 | Line 758 | public class AbstractQueuedLongSynchroni
758       * awaitUninterruptibly doesn't abort on interrupt
759       */
760      public void testAwaitUninterruptibly() throws InterruptedException {
761 <        final Mutex sync = new Mutex();
761 >        final Mutex sync = new Mutex();
762          final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
763 <        Thread t = new Thread(new CheckedRunnable() {
763 >        Thread t = new Thread(new CheckedRunnable() {
764              public void realRun() {
765                  sync.acquire(1);
766                  c.awaitUninterruptibly();
# Line 781 | Line 781 | public class AbstractQueuedLongSynchroni
781       * await is interruptible
782       */
783      public void testAwait_Interrupt() throws InterruptedException {
784 <        final Mutex sync = new Mutex();
784 >        final Mutex sync = new Mutex();
785          final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
786 <        Thread t = new Thread(new CheckedInterruptedRunnable() {
787 <            public void realRun() throws InterruptedException {
786 >        Thread t = new Thread(new CheckedInterruptedRunnable() {
787 >            public void realRun() throws InterruptedException {
788                  sync.acquire(1);
789                  c.await();
790                  sync.release(1);
# Line 801 | Line 801 | public class AbstractQueuedLongSynchroni
801       * awaitNanos is interruptible
802       */
803      public void testAwaitNanos_Interrupt() throws InterruptedException {
804 <        final Mutex sync = new Mutex();
804 >        final Mutex sync = new Mutex();
805          final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
806 <        Thread t = new Thread(new CheckedInterruptedRunnable() {
807 <            public void realRun() throws InterruptedException {
806 >        Thread t = new Thread(new CheckedInterruptedRunnable() {
807 >            public void realRun() throws InterruptedException {
808                  sync.acquire(1);
809                  c.awaitNanos(1000 * 1000 * 1000); // 1 sec
810                  sync.release(1);
# Line 821 | Line 821 | public class AbstractQueuedLongSynchroni
821       * awaitUntil is interruptible
822       */
823      public void testAwaitUntil_Interrupt() throws InterruptedException {
824 <        final Mutex sync = new Mutex();
824 >        final Mutex sync = new Mutex();
825          final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
826 <        Thread t = new Thread(new CheckedInterruptedRunnable() {
827 <            public void realRun() throws InterruptedException {
826 >        Thread t = new Thread(new CheckedInterruptedRunnable() {
827 >            public void realRun() throws InterruptedException {
828                  sync.acquire(1);
829                  java.util.Date d = new java.util.Date();
830                  c.awaitUntil(new java.util.Date(d.getTime() + 10000));
# Line 842 | Line 842 | public class AbstractQueuedLongSynchroni
842       * signalAll wakes up all threads
843       */
844      public void testSignalAll() throws InterruptedException {
845 <        final Mutex sync = new Mutex();
845 >        final Mutex sync = new Mutex();
846          final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
847 <        Thread t1 = new Thread(new CheckedRunnable() {
847 >        Thread t1 = new Thread(new CheckedRunnable() {
848              public void realRun() throws InterruptedException {
849                  sync.acquire(1);
850                  c.await();
851                  sync.release(1);
852              }});
853  
854 <        Thread t2 = new Thread(new CheckedRunnable() {
854 >        Thread t2 = new Thread(new CheckedRunnable() {
855              public void realRun() throws InterruptedException {
856                  sync.acquire(1);
857                  c.await();
# Line 907 | Line 907 | public class AbstractQueuedLongSynchroni
907       * tryReleaseShared setting state changes getState
908       */
909      public void testGetStateWithReleaseShared() {
910 <        final BooleanLatch l = new BooleanLatch();
911 <        assertFalse(l.isSignalled());
912 <        l.releaseShared(0);
913 <        assertTrue(l.isSignalled());
910 >        final BooleanLatch l = new BooleanLatch();
911 >        assertFalse(l.isSignalled());
912 >        l.releaseShared(0);
913 >        assertTrue(l.isSignalled());
914      }
915  
916      /**
917       * releaseShared has no effect when already signalled
918       */
919      public void testReleaseShared() {
920 <        final BooleanLatch l = new BooleanLatch();
921 <        assertFalse(l.isSignalled());
922 <        l.releaseShared(0);
923 <        assertTrue(l.isSignalled());
924 <        l.releaseShared(0);
925 <        assertTrue(l.isSignalled());
920 >        final BooleanLatch l = new BooleanLatch();
921 >        assertFalse(l.isSignalled());
922 >        l.releaseShared(0);
923 >        assertTrue(l.isSignalled());
924 >        l.releaseShared(0);
925 >        assertTrue(l.isSignalled());
926      }
927  
928      /**
929       * acquireSharedInterruptibly returns after release, but not before
930       */
931      public void testAcquireSharedInterruptibly() throws InterruptedException {
932 <        final BooleanLatch l = new BooleanLatch();
932 >        final BooleanLatch l = new BooleanLatch();
933  
934 <        Thread t = new Thread(new CheckedRunnable() {
934 >        Thread t = new Thread(new CheckedRunnable() {
935              public void realRun() throws InterruptedException {
936                  threadAssertFalse(l.isSignalled());
937                  l.acquireSharedInterruptibly(0);
# Line 951 | Line 951 | public class AbstractQueuedLongSynchroni
951       * acquireSharedTimed returns after release
952       */
953      public void testAsquireSharedTimed() throws InterruptedException {
954 <        final BooleanLatch l = new BooleanLatch();
954 >        final BooleanLatch l = new BooleanLatch();
955  
956 <        Thread t = new Thread(new CheckedRunnable() {
956 >        Thread t = new Thread(new CheckedRunnable() {
957              public void realRun() throws InterruptedException {
958                  threadAssertFalse(l.isSignalled());
959                  threadAssertTrue(l.tryAcquireSharedNanos(0, MEDIUM_DELAY_MS* 1000 * 1000));
# Line 973 | Line 973 | public class AbstractQueuedLongSynchroni
973       */
974      public void testAcquireSharedInterruptibly_InterruptedException() throws InterruptedException {
975          final BooleanLatch l = new BooleanLatch();
976 <        Thread t = new Thread(new CheckedInterruptedRunnable() {
977 <            public void realRun() throws InterruptedException {
976 >        Thread t = new Thread(new CheckedInterruptedRunnable() {
977 >            public void realRun() throws InterruptedException {
978                  threadAssertFalse(l.isSignalled());
979                  l.acquireSharedInterruptibly(0);
980              }});
981  
982 <        t.start();
982 >        t.start();
983          assertFalse(l.isSignalled());
984          t.interrupt();
985          t.join();
# Line 990 | Line 990 | public class AbstractQueuedLongSynchroni
990       */
991      public void testAcquireSharedNanos_InterruptedException() throws InterruptedException {
992          final BooleanLatch l = new BooleanLatch();
993 <        Thread t = new Thread(new CheckedInterruptedRunnable() {
994 <            public void realRun() throws InterruptedException {
993 >        Thread t = new Thread(new CheckedInterruptedRunnable() {
994 >            public void realRun() throws InterruptedException {
995                  threadAssertFalse(l.isSignalled());
996                  l.tryAcquireSharedNanos(0, SMALL_DELAY_MS* 1000 * 1000);
997              }});
# Line 1008 | Line 1008 | public class AbstractQueuedLongSynchroni
1008       */
1009      public void testAcquireSharedNanos_Timeout() throws InterruptedException {
1010          final BooleanLatch l = new BooleanLatch();
1011 <        Thread t = new Thread(new CheckedRunnable() {
1011 >        Thread t = new Thread(new CheckedRunnable() {
1012              public void realRun() throws InterruptedException {
1013                  threadAssertFalse(l.isSignalled());
1014                  threadAssertFalse(l.tryAcquireSharedNanos(0, SMALL_DELAY_MS* 1000 * 1000));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines