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

Comparing jsr166/src/test/tck/ReentrantLockTest.java (file contents):
Revision 1.6 by dl, Sat Sep 20 18:20:08 2003 UTC vs.
Revision 1.7 by dl, Thu Sep 25 11:02:41 2003 UTC

# Line 113 | Line 113 | public class ReentrantLockTest extends J
113  
114  
115      /*
116 <     * getLockQueueLength reports number of waiting threads
116 >     * getQueueLength reports number of waiting threads
117       */
118 <    public void testGetLockQueueLength() {
118 >    public void testGetQueueLength() {
119          final ReentrantLock lock = new ReentrantLock();
120          Thread t1 = new Thread(new InterruptedLockRunnable(lock));
121          Thread t2 = new Thread(new InterruptibleLockRunnable(lock));
122          try {
123 <            assertEquals(0, lock.getLockQueueLength());
123 >            assertEquals(0, lock.getQueueLength());
124              lock.lock();
125              t1.start();
126              Thread.sleep(SHORT_DELAY_MS);
127 <            assertEquals(1, lock.getLockQueueLength());
127 >            assertEquals(1, lock.getQueueLength());
128              t2.start();
129              Thread.sleep(SHORT_DELAY_MS);
130 <            assertEquals(2, lock.getLockQueueLength());
130 >            assertEquals(2, lock.getQueueLength());
131              t1.interrupt();
132              Thread.sleep(SHORT_DELAY_MS);
133 <            assertEquals(1, lock.getLockQueueLength());
133 >            assertEquals(1, lock.getQueueLength());
134              lock.unlock();
135              Thread.sleep(SHORT_DELAY_MS);
136 <            assertEquals(0, lock.getLockQueueLength());
136 >            assertEquals(0, lock.getQueueLength());
137              t1.join();
138              t2.join();
139          } catch(Exception e){

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines