15 |
|
|
16 |
|
public class ReentrantLockTest extends JSR166TestCase { |
17 |
|
public static void main(String[] args) { |
18 |
< |
junit.textui.TestRunner.run (suite()); |
18 |
> |
junit.textui.TestRunner.run(suite()); |
19 |
|
} |
20 |
|
public static Test suite() { |
21 |
|
return new TestSuite(ReentrantLockTest.class); |
56 |
|
public Collection<Thread> getWaitingThreads(Condition c) { |
57 |
|
return super.getWaitingThreads(c); |
58 |
|
} |
59 |
– |
|
60 |
– |
|
59 |
|
} |
60 |
|
|
61 |
|
/** |
268 |
|
}}); |
269 |
|
|
270 |
|
t.start(); |
271 |
+ |
Thread.sleep(SHORT_DELAY_MS); |
272 |
|
t.interrupt(); |
273 |
|
t.join(); |
274 |
|
} |
369 |
|
lock.lockInterruptibly(); |
370 |
|
Thread t = new Thread(new InterruptedLockRunnable(lock)); |
371 |
|
t.start(); |
372 |
+ |
Thread.sleep(SHORT_DELAY_MS); |
373 |
|
t.interrupt(); |
374 |
|
assertTrue(lock.isLocked()); |
375 |
|
assertTrue(lock.isHeldByCurrentThread()); |
774 |
|
Thread t = new Thread(new CheckedInterruptedRunnable() { |
775 |
|
public void realRun() throws InterruptedException { |
776 |
|
lock.lock(); |
777 |
< |
c.awaitNanos(1000 * 1000 * 1000); // 1 sec |
777 |
> |
c.awaitNanos(MILLISECONDS.toNanos(LONG_DELAY_MS)); |
778 |
|
}}); |
779 |
|
|
780 |
|
t.start(); |
887 |
|
new ObjectOutputStream(new BufferedOutputStream(bout)); |
888 |
|
out.writeObject(l); |
889 |
|
out.close(); |
890 |
< |
|
890 |
> |
|
891 |
|
ByteArrayInputStream bin = |
892 |
|
new ByteArrayInputStream(bout.toByteArray()); |
893 |
|
ObjectInputStream in = |