8 |
|
* @summary basic safety and liveness of ReentrantLocks, and other locks based on them |
9 |
|
*/ |
10 |
|
|
11 |
+ |
import java.util.*; |
12 |
|
import java.util.concurrent.*; |
13 |
|
import java.util.concurrent.locks.*; |
13 |
– |
import java.util.*; |
14 |
|
|
15 |
|
public final class CheckedLockLoops { |
16 |
|
static final ExecutorService pool = Executors.newCachedThreadPool(); |
398 |
|
|
399 |
|
} |
400 |
|
|
401 |
– |
|
401 |
|
private static class FairReentrantReadWriteLockLoop extends LockLoop { |
402 |
|
private final ReentrantReadWriteLock lock = new ReentrantReadWriteLock(true); |
403 |
|
final int loop(int n) { |