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.14 by jsr166, Mon Nov 30 08:31:09 2009 UTC vs.
Revision 1.15 by jsr166, Tue Dec 1 06:03:49 2009 UTC

# Line 330 | Line 330 | public class AbstractQueuedLongSynchroni
330          sync.acquire(1);
331          Thread t = new Thread(new CheckedInterruptedRunnable() {
332              public void realRun() throws InterruptedException {
333 <                sync.tryAcquireNanos(1, MEDIUM_DELAY_MS * 1000L * 1000L);
333 >                sync.tryAcquireNanos(1, MILLISECONDS.toNanos(MEDIUM_DELAY_MS));
334              }});
335  
336          t.start();
# Line 364 | Line 364 | public class AbstractQueuedLongSynchroni
364          sync.acquire(1);
365          Thread t = new Thread(new CheckedRunnable() {
366              public void realRun() throws InterruptedException {
367 <                threadAssertFalse(sync.tryAcquireNanos(1, SHORT_DELAY_MS * 1000L * 1000L));
367 >                long nanos = MILLISECONDS.toNanos(SHORT_DELAY_MS);
368 >                assertFalse(sync.tryAcquireNanos(1, nanos));
369              }});
370  
371          t.start();
# Line 808 | Line 809 | public class AbstractQueuedLongSynchroni
809          Thread t = new Thread(new CheckedInterruptedRunnable() {
810              public void realRun() throws InterruptedException {
811                  sync.acquire(1);
812 <                c.awaitNanos(LONG_DELAY_MS * 1000L * 1000L);
812 >                c.awaitNanos(MILLISECONDS.toNanos(LONG_DELAY_MS));
813              }});
814  
815          t.start();
# Line 955 | Line 956 | public class AbstractQueuedLongSynchroni
956  
957          Thread t = new Thread(new CheckedRunnable() {
958              public void realRun() throws InterruptedException {
959 <                threadAssertFalse(l.isSignalled());
960 <                threadAssertTrue(l.tryAcquireSharedNanos(0, MEDIUM_DELAY_MS * 1000L * 1000L));
961 <                threadAssertTrue(l.isSignalled());
959 >                assertFalse(l.isSignalled());
960 >                long nanos = MILLISECONDS.toNanos(MEDIUM_DELAY_MS);
961 >                assertTrue(l.tryAcquireSharedNanos(0, nanos));
962 >                assertTrue(l.isSignalled());
963              }});
964  
965          t.start();
# Line 992 | Line 994 | public class AbstractQueuedLongSynchroni
994          final BooleanLatch l = new BooleanLatch();
995          Thread t = new Thread(new CheckedInterruptedRunnable() {
996              public void realRun() throws InterruptedException {
997 <                threadAssertFalse(l.isSignalled());
998 <                l.tryAcquireSharedNanos(0, SMALL_DELAY_MS * 1000L * 1000L);
997 >                assertFalse(l.isSignalled());
998 >                long nanos = MILLISECONDS.toNanos(SMALL_DELAY_MS);
999 >                l.tryAcquireSharedNanos(0, nanos);
1000              }});
1001  
1002          t.start();
# Line 1010 | Line 1013 | public class AbstractQueuedLongSynchroni
1013          final BooleanLatch l = new BooleanLatch();
1014          Thread t = new Thread(new CheckedRunnable() {
1015              public void realRun() throws InterruptedException {
1016 <                threadAssertFalse(l.isSignalled());
1017 <                threadAssertFalse(l.tryAcquireSharedNanos(0, SMALL_DELAY_MS * 1000L * 1000L));
1016 >                assertFalse(l.isSignalled());
1017 >                long nanos = MILLISECONDS.toNanos(SMALL_DELAY_MS);
1018 >                assertFalse(l.tryAcquireSharedNanos(0, nanos));
1019              }});
1020  
1021          t.start();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines