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.31 by jsr166, Sat Nov 21 17:54:04 2009 UTC vs.
Revision 1.32 by jsr166, Mon Nov 30 08:31:09 2009 UTC

# Line 327 | Line 327 | public class AbstractQueuedSynchronizerT
327          sync.acquire(1);
328          Thread t = new Thread(new CheckedInterruptedRunnable() {
329              public void realRun() throws InterruptedException {
330 <                sync.tryAcquireNanos(1, MEDIUM_DELAY_MS * 1000 * 1000);
330 >                sync.tryAcquireNanos(1, MEDIUM_DELAY_MS * 1000L * 1000L);
331              }});
332  
333          t.start();
334 +        Thread.sleep(SHORT_DELAY_MS);
335          t.interrupt();
336          t.join();
337      }
# Line 360 | Line 361 | public class AbstractQueuedSynchronizerT
361          sync.acquire(1);
362          Thread t = new Thread(new CheckedRunnable() {
363              public void realRun() throws InterruptedException {
364 <                threadAssertFalse(sync.tryAcquireNanos(1, 1000 * 1000));
364 >                threadAssertFalse(sync.tryAcquireNanos(1, SHORT_DELAY_MS * 1000L * 1000L));
365              }});
366  
367          t.start();
# Line 417 | Line 418 | public class AbstractQueuedSynchronizerT
418          sync.acquireInterruptibly(1);
419          Thread t = new Thread(new InterruptedSyncRunnable(sync));
420          t.start();
421 +        Thread.sleep(SHORT_DELAY_MS);
422          t.interrupt();
423          assertTrue(sync.isHeldExclusively());
424          t.join();
# Line 804 | Line 806 | public class AbstractQueuedSynchronizerT
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
809 >                c.awaitNanos(LONG_DELAY_MS * 1000L * 1000L);
810              }});
811  
812          t.start();
# Line 952 | Line 954 | public class AbstractQueuedSynchronizerT
954          Thread t = new Thread(new CheckedRunnable() {
955              public void realRun() throws InterruptedException {
956                  threadAssertFalse(l.isSignalled());
957 <                threadAssertTrue(l.tryAcquireSharedNanos(0, MEDIUM_DELAY_MS* 1000 * 1000));
957 >                threadAssertTrue(l.tryAcquireSharedNanos(0, MEDIUM_DELAY_MS * 1000L * 1000L));
958                  threadAssertTrue(l.isSignalled());
959              }});
960  
# Line 989 | Line 991 | public class AbstractQueuedSynchronizerT
991          Thread t = new Thread(new CheckedInterruptedRunnable() {
992              public void realRun() throws InterruptedException {
993                  threadAssertFalse(l.isSignalled());
994 <                l.tryAcquireSharedNanos(0, SMALL_DELAY_MS* 1000 * 1000);
994 >                l.tryAcquireSharedNanos(0, SMALL_DELAY_MS * 1000L * 1000L);
995              }});
996  
997          t.start();
# Line 1007 | Line 1009 | public class AbstractQueuedSynchronizerT
1009          Thread t = new Thread(new CheckedRunnable() {
1010              public void realRun() throws InterruptedException {
1011                  threadAssertFalse(l.isSignalled());
1012 <                threadAssertFalse(l.tryAcquireSharedNanos(0, SMALL_DELAY_MS* 1000 * 1000));
1012 >                threadAssertFalse(l.tryAcquireSharedNanos(0, SMALL_DELAY_MS * 1000L * 1000L));
1013              }});
1014  
1015          t.start();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines