ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/loops/UncheckedLockLoops.java
(Generate patch)

Comparing jsr166/src/test/loops/UncheckedLockLoops.java (file contents):
Revision 1.8 by jsr166, Mon Sep 27 19:15:16 2010 UTC vs.
Revision 1.12 by jsr166, Mon Aug 10 03:13:34 2015 UTC

# Line 1 | Line 1
1   /*
2   * Written by Doug Lea with assistance from members of JCP JSR-166
3   * Expert Group and released to the public domain, as explained at
4 < * http://creativecommons.org/licenses/publicdomain
4 > * http://creativecommons.org/publicdomain/zero/1.0/
5   */
6   /*
7   * @test
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 UncheckedLockLoops {
16      static final LoopHelpers.SimpleRandom rng = new LoopHelpers.SimpleRandom();
# Line 49 | Line 49 | public final class UncheckedLockLoops {
49              oneTest(i, iters / i);
50              Thread.sleep(100);
51          }
52
52      }
53  
54      static void oneTest(int nthreads, int iters) throws Exception {
# Line 118 | Line 117 | public final class UncheckedLockLoops {
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 {
# Line 403 | Line 401 | public final class UncheckedLockLoops {
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) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines