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.util.*; |
14 |
|
import java.io.*; |
15 |
|
|
266 |
|
lock.lock(); |
267 |
|
Thread t = new Thread(new CheckedInterruptedRunnable() { |
268 |
|
public void realRun() throws InterruptedException { |
269 |
< |
lock.tryLock(MEDIUM_DELAY_MS,TimeUnit.MILLISECONDS); |
269 |
> |
lock.tryLock(MEDIUM_DELAY_MS,MILLISECONDS); |
270 |
|
}}); |
271 |
|
|
272 |
|
t.start(); |
299 |
|
lock.lock(); |
300 |
|
Thread t = new Thread(new CheckedRunnable() { |
301 |
|
public void realRun() throws InterruptedException { |
302 |
< |
threadAssertFalse(lock.tryLock(1, TimeUnit.MILLISECONDS)); |
302 |
> |
threadAssertFalse(lock.tryLock(1, MILLISECONDS)); |
303 |
|
}}); |
304 |
|
|
305 |
|
t.start(); |
419 |
|
final ReentrantLock lock = new ReentrantLock(); |
420 |
|
final Condition c = lock.newCondition(); |
421 |
|
lock.lock(); |
422 |
< |
assertFalse(c.await(SHORT_DELAY_MS, TimeUnit.MILLISECONDS)); |
422 |
> |
assertFalse(c.await(SHORT_DELAY_MS, MILLISECONDS)); |
423 |
|
lock.unlock(); |
424 |
|
} |
425 |
|
|