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.11 by jsr166, Fri Feb 27 21:43:18 2015 UTC vs.
Revision 1.12 by jsr166, Fri Feb 27 21:54:13 2015 UTC

# Line 285 | Line 285 | public class StampedLockTest extends JSR
285                  running.countDown();
286                  lock.writeLockInterruptibly();
287              }});
288 <        
288 >
289          running.await();
290          waitForThreadToEnterWaitState(t, 100);
291          t.interrupt();
# Line 305 | Line 305 | public class StampedLockTest extends JSR
305                  running.countDown();
306                  lock.tryWriteLock(2 * LONG_DELAY_MS, MILLISECONDS);
307              }});
308 <        
308 >
309          running.await();
310          waitForThreadToEnterWaitState(t, 100);
311          t.interrupt();
# Line 326 | Line 326 | public class StampedLockTest extends JSR
326                  running.countDown();
327                  lock.readLockInterruptibly();
328              }});
329 <        
329 >
330          running.await();
331          waitForThreadToEnterWaitState(t, 100);
332          t.interrupt();
# Line 346 | Line 346 | public class StampedLockTest extends JSR
346                  running.countDown();
347                  lock.tryReadLock(2 * LONG_DELAY_MS, MILLISECONDS);
348              }});
349 <        
349 >
350          running.await();
351          waitForThreadToEnterWaitState(t, 100);
352          t.interrupt();
# Line 378 | Line 378 | public class StampedLockTest extends JSR
378                  long ws = lock.tryWriteLock();
379                  assertTrue(ws == 0L);
380              }});
381 <        
381 >
382          awaitTermination(t);
383          releaseWriteLock(lock, s);
384      }
# Line 394 | Line 394 | public class StampedLockTest extends JSR
394                  long rs = lock.tryReadLock();
395                  assertEquals(rs, 0L);
396              }});
397 <        
397 >
398          awaitTermination(t);
399          releaseWriteLock(lock, s);
400      }
# Line 416 | Line 416 | public class StampedLockTest extends JSR
416                  long s4 = lock.readLock();
417                  lock.unlockRead(s4);
418              }});
419 <        
419 >
420          awaitTermination(t);
421          lock.unlockRead(s);
422      }
# Line 434 | Line 434 | public class StampedLockTest extends JSR
434                  long s = lock.writeLock();
435                  lock.unlockWrite(s);
436              }});
437 <        
437 >
438          running.await();
439          waitForThreadToEnterWaitState(t, 100);
440          assertFalse(lock.isWriteLocked());
# Line 454 | Line 454 | public class StampedLockTest extends JSR
454                  long rs = lock.readLock();
455                  lock.unlockRead(rs);
456              }});
457 <        
457 >
458          awaitTermination(t1);
459  
460          Thread t2 = newStartedThread(new CheckedRunnable() {
# Line 462 | Line 462 | public class StampedLockTest extends JSR
462                  long ws = lock.writeLock();
463                  lock.unlockWrite(ws);
464              }});
465 <        
465 >
466          assertFalse(lock.isWriteLocked());
467          lock.unlockRead(s);
468          awaitTermination(t2);
# Line 599 | Line 599 | public class StampedLockTest extends JSR
599                  running.countDown();
600                  lock.readLockInterruptibly();
601              }});
602 <        
602 >
603          running.await();
604          waitForThreadToEnterWaitState(t, 100);
605          t.interrupt();
# Line 704 | Line 704 | public class StampedLockTest extends JSR
704                  running.countDown();
705                  lock.writeLockInterruptibly();
706              }});
707 <        
707 >
708          running.await();
709          assertFalse(lock.validate(p));
710          assertFalse((p = lock.tryOptimisticRead()) != 0L);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines