29 |
|
} |
30 |
|
|
31 |
|
/** |
32 |
< |
* A runnable calling lockInterruptibly |
32 |
> |
* A checked runnable calling lockInterruptibly |
33 |
|
*/ |
34 |
|
class InterruptibleLockRunnable extends CheckedRunnable { |
35 |
|
final ReentrantLock lock; |
36 |
< |
InterruptibleLockRunnable(ReentrantLock l) { lock = l; } |
36 |
> |
InterruptibleLockRunnable(ReentrantLock lock) { this.lock = lock; } |
37 |
|
public void realRun() throws InterruptedException { |
38 |
|
lock.lockInterruptibly(); |
39 |
|
} |
40 |
|
} |
41 |
|
|
42 |
|
/** |
43 |
< |
* A runnable calling lockInterruptibly that expects to be |
43 |
> |
* A checked runnable calling lockInterruptibly that expects to be |
44 |
|
* interrupted |
45 |
|
*/ |
46 |
|
class InterruptedLockRunnable extends CheckedInterruptedRunnable { |
47 |
|
final ReentrantLock lock; |
48 |
< |
InterruptedLockRunnable(ReentrantLock l) { lock = l; } |
48 |
> |
InterruptedLockRunnable(ReentrantLock lock) { this.lock = lock; } |
49 |
|
public void realRun() throws InterruptedException { |
50 |
|
lock.lockInterruptibly(); |
51 |
|
} |