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.4 by jsr166, Wed Sep 1 07:20:36 2010 UTC vs.
Revision 1.6 by jsr166, Tue Oct 25 20:29:12 2011 UTC

# Line 1 | Line 1
1   /*
2   * Written by Doug Lea with assistance from members of JCP JSR-166
3   * Expert Group and released to the public domain, as explained at
4 < * http://creativecommons.org/licenses/publicdomain
4 > * http://creativecommons.org/publicdomain/zero/1.0/
5   */
6   import java.util.concurrent.locks.*;
7  
# 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());

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines