8 |
|
* @summary basic safety and liveness of ReentrantLocks, and other locks based on them |
9 |
|
*/ |
10 |
|
|
11 |
< |
import java.util.concurrent.*; |
12 |
< |
import java.util.concurrent.locks.*; |
13 |
< |
import java.util.*; |
11 |
> |
import java.util.concurrent.CyclicBarrier; |
12 |
> |
import java.util.concurrent.ExecutorService; |
13 |
> |
import java.util.concurrent.Executors; |
14 |
> |
import java.util.concurrent.Semaphore; |
15 |
> |
import java.util.concurrent.locks.Lock; |
16 |
> |
import java.util.concurrent.locks.ReentrantLock; |
17 |
> |
import java.util.concurrent.locks.ReentrantReadWriteLock; |
18 |
|
|
19 |
|
public final class CheckedLockLoops { |
20 |
|
static final ExecutorService pool = Executors.newCachedThreadPool(); |
402 |
|
|
403 |
|
} |
404 |
|
|
401 |
– |
|
405 |
|
private static class FairReentrantReadWriteLockLoop extends LockLoop { |
406 |
|
private final ReentrantReadWriteLock lock = new ReentrantReadWriteLock(true); |
407 |
|
final int loop(int n) { |