9 |
|
import junit.framework.*; |
10 |
|
import java.util.concurrent.locks.*; |
11 |
|
import java.util.concurrent.*; |
12 |
+ |
import static java.util.concurrent.TimeUnit.MILLISECONDS; |
13 |
|
import java.io.*; |
14 |
|
import java.util.*; |
15 |
|
|
215 |
|
lock.writeLock().lock(); |
216 |
|
Thread t = new Thread(new CheckedInterruptedRunnable() { |
217 |
|
public void realRun() throws InterruptedException { |
218 |
< |
lock.writeLock().tryLock(1000,TimeUnit.MILLISECONDS); |
218 |
> |
lock.writeLock().tryLock(1000,MILLISECONDS); |
219 |
|
}}); |
220 |
|
|
221 |
|
t.start(); |
251 |
|
lock.writeLock().lock(); |
252 |
|
Thread t = new Thread(new CheckedInterruptedRunnable() { |
253 |
|
public void realRun() throws InterruptedException { |
254 |
< |
lock.readLock().tryLock(1000,TimeUnit.MILLISECONDS); |
254 |
> |
lock.readLock().tryLock(1000,MILLISECONDS); |
255 |
|
}}); |
256 |
|
|
257 |
|
t.start(); |
689 |
|
lock.writeLock().lock(); |
690 |
|
Thread t = new Thread(new CheckedRunnable() { |
691 |
|
public void realRun() throws InterruptedException { |
692 |
< |
threadAssertFalse(lock.writeLock().tryLock(1, TimeUnit.MILLISECONDS)); |
692 |
> |
threadAssertFalse(lock.writeLock().tryLock(1, MILLISECONDS)); |
693 |
|
}}); |
694 |
|
|
695 |
|
t.start(); |
706 |
|
lock.writeLock().lock(); |
707 |
|
Thread t = new Thread(new CheckedRunnable() { |
708 |
|
public void realRun() throws InterruptedException { |
709 |
< |
threadAssertFalse(lock.readLock().tryLock(1, TimeUnit.MILLISECONDS)); |
709 |
> |
threadAssertFalse(lock.readLock().tryLock(1, MILLISECONDS)); |
710 |
|
}}); |
711 |
|
|
712 |
|
t.start(); |
798 |
|
final ReentrantReadWriteLock lock = new ReentrantReadWriteLock(); |
799 |
|
final Condition c = lock.writeLock().newCondition(); |
800 |
|
lock.writeLock().lock(); |
801 |
< |
assertFalse(c.await(SHORT_DELAY_MS, TimeUnit.MILLISECONDS)); |
801 |
> |
assertFalse(c.await(SHORT_DELAY_MS, MILLISECONDS)); |
802 |
|
lock.writeLock().unlock(); |
803 |
|
} |
804 |
|
|