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.7 by jsr166, Thu Jan 15 18:34:19 2015 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines