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

Comparing jsr166/src/test/loops/ReadHoldingWriteLock.java (file contents):
Revision 1.5 by jsr166, Tue Mar 15 19:47:05 2011 UTC vs.
Revision 1.8 by jsr166, Mon Aug 10 03:13:33 2015 UTC

# Line 50 | Line 50 | class ReadHoldingWriteLock {
50          t2.join(MEDIUM_DELAY_MS);
51          assertTrue(!t1.isAlive());
52          assertTrue(!t2.isAlive());
53
53      }
54  
55      /**
# Line 68 | Line 67 | class ReadHoldingWriteLock {
67       * Read lock succeeds if write locked by current thread even if
68       * other threads are waiting
69       */
70 <    public void testReadHoldingWriteLock2() throws Exception{
70 >    public void testReadHoldingWriteLock2() throws Exception {
71          final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
72          lock.writeLock().lock();
73          Thread t1 = new Thread(new Runnable() {
# Line 101 | Line 100 | class ReadHoldingWriteLock {
100      /**
101       * Fair Read trylock succeeds if write locked by current thread
102       */
103 <    public void testReadHoldingWriteLockFair() throws Exception{
103 >    public void testReadHoldingWriteLockFair() throws Exception {
104          final ReentrantReadWriteLock lock = new ReentrantReadWriteLock(true);
105          lock.writeLock().lock();
106          assertTrue(lock.readLock().tryLock());
# Line 141 | Line 140 | class ReadHoldingWriteLock {
140          t2.join(MEDIUM_DELAY_MS);
141          assertTrue(!t1.isAlive());
142          assertTrue(!t2.isAlive());
144
145
143      }
144   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines