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

Comparing jsr166/src/test/tck/ReentrantReadWriteLockTest.java (file contents):
Revision 1.15 by dl, Mon Dec 29 19:05:40 2003 UTC vs.
Revision 1.16 by dl, Wed Jan 7 01:02:17 2004 UTC

# Line 156 | Line 156 | public class ReentrantReadWriteLockTest
156       */
157      public void testWriteLockInterruptibly_Interrupted() {
158          final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
159        lock.writeLock().lock();
159          Thread t = new Thread(new Runnable() {
160                  public void run() {
161                      try {
162                          lock.writeLock().lockInterruptibly();
163 <                        threadShouldThrow();
163 >                        lock.writeLock().unlock();
164 >                        lock.writeLock().lockInterruptibly();
165 >                        lock.writeLock().unlock();
166                      } catch(InterruptedException success){}
167                  }
168              });
169          try {
170 +            lock.writeLock().lock();
171              t.start();
172              t.interrupt();
173              lock.writeLock().unlock();
# Line 209 | Line 211 | public class ReentrantReadWriteLockTest
211                  public void run() {
212                      try {
213                          lock.readLock().lockInterruptibly();
212                        threadShouldThrow();
214                      } catch(InterruptedException success){}
215                  }
216              });

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines