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

Comparing jsr166/src/test/tck/StampedLockTest.java (file contents):
Revision 1.5 by dl, Thu Mar 21 16:26:43 2013 UTC vs.
Revision 1.6 by dl, Thu Mar 21 19:06:54 2013 UTC

# Line 293 | Line 293 | public class StampedLockTest extends JSR
293                  lock.writeLockInterruptibly();
294              }});
295          try {
296 <            running.await(); Thread.sleep(SHORT_DELAY_MS);
296 >            running.await();
297 >            waitForThreadToEnterWaitState(t, 100);
298              t.interrupt();
299              awaitTermination(t);
300              releaseWriteLock(lock, s);
# Line 315 | Line 316 | public class StampedLockTest extends JSR
316                  lock.tryWriteLock(2 * LONG_DELAY_MS, MILLISECONDS);
317              }});
318          try {
319 <            running.await(); Thread.sleep(SHORT_DELAY_MS);
319 >            running.await();
320 >            waitForThreadToEnterWaitState(t, 100);
321              t.interrupt();
322              awaitTermination(t);
323              releaseWriteLock(lock, s);
# Line 337 | Line 339 | public class StampedLockTest extends JSR
339                  lock.readLockInterruptibly();
340              }});
341          try {
342 <            running.await(); Thread.sleep(SHORT_DELAY_MS);
342 >            running.await();
343 >            waitForThreadToEnterWaitState(t, 100);
344              t.interrupt();
345              awaitTermination(t);
346              releaseWriteLock(lock, s);
# Line 359 | Line 362 | public class StampedLockTest extends JSR
362                  lock.tryReadLock(2 * LONG_DELAY_MS, MILLISECONDS);
363              }});
364          try {
365 <            running.await(); Thread.sleep(SHORT_DELAY_MS);
365 >            running.await();
366 >            waitForThreadToEnterWaitState(t, 100);
367              t.interrupt();
368              awaitTermination(t);
369              releaseWriteLock(lock, s);
# Line 449 | Line 453 | public class StampedLockTest extends JSR
453                  lock.unlockWrite(s);
454              }});
455          try {
456 <            running.await(); Thread.sleep(SHORT_DELAY_MS);
456 >            running.await();
457 >            waitForThreadToEnterWaitState(t, 100);
458              assertFalse(lock.isWriteLocked());
459              lock.unlockRead(rs);
460              awaitTermination(t);
# Line 596 | Line 601 | public class StampedLockTest extends JSR
601              }});
602  
603          try {
604 <            running.await(); Thread.sleep(SHORT_DELAY_MS);
604 >            running.await();
605 >            waitForThreadToEnterWaitState(t, 100);
606              t.interrupt();
607              assertTrue(lock.isWriteLocked());
608              awaitTermination(t);
# Line 627 | Line 633 | public class StampedLockTest extends JSR
633                  lock.readLockInterruptibly();
634              }});
635          try {
636 <            running.await(); Thread.sleep(SHORT_DELAY_MS);
636 >            running.await();
637 >            waitForThreadToEnterWaitState(t, 100);
638              t.interrupt();
639              awaitTermination(t);
640              releaseWriteLock(lock, s);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines