49 |
|
oneTest(i, iters / i); |
50 |
|
Thread.sleep(100); |
51 |
|
} |
52 |
– |
|
52 |
|
} |
53 |
|
|
54 |
|
static void oneTest(int nthreads, int iters) throws Exception { |
117 |
|
System.out.print("FairRReadWriteLock "); |
118 |
|
new FairReentrantReadWriteLockLoop().test(v, nthreads, fairIters); |
119 |
|
Thread.sleep(10); |
121 |
– |
|
120 |
|
} |
121 |
|
|
122 |
|
abstract static class LockLoop implements Runnable { |
401 |
|
|
402 |
|
} |
403 |
|
|
406 |
– |
|
404 |
|
private static class FairReentrantReadWriteLockLoop extends LockLoop { |
405 |
|
private final ReentrantReadWriteLock lock = new ReentrantReadWriteLock(true); |
406 |
|
final int loop(int n) { |