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

Comparing jsr166/src/test/loops/CheckedLockLoops.java (file contents):
Revision 1.6 by jsr166, Thu Sep 16 03:57:13 2010 UTC vs.
Revision 1.7 by jsr166, Mon Sep 27 19:15:15 2010 UTC

# Line 118 | Line 118 | public final class CheckedLockLoops {
118          Thread.sleep(10);
119      }
120  
121 <    static abstract class LockLoop implements Runnable {
121 >    abstract static class LockLoop implements Runnable {
122          int value;
123          int checkValue;
124          int iters;
# Line 207 | Line 207 | public final class CheckedLockLoops {
207      }
208  
209      private static class ReentrantLockLoop extends LockLoop {
210 <        final private ReentrantLock lock = new ReentrantLock();
210 >        private final ReentrantLock lock = new ReentrantLock();
211          final int loop(int n) {
212              final ReentrantLock lock = this.lock;
213              int sum = 0;
# Line 227 | Line 227 | public final class CheckedLockLoops {
227      }
228  
229      private static class MutexLoop extends LockLoop {
230 <        final private Mutex lock = new Mutex();
230 >        private final Mutex lock = new Mutex();
231          final int loop(int n) {
232              final Mutex lock = this.lock;
233              int sum = 0;
# Line 247 | Line 247 | public final class CheckedLockLoops {
247      }
248  
249      private static class LongMutexLoop extends LockLoop {
250 <        final private LongMutex lock = new LongMutex();
250 >        private final LongMutex lock = new LongMutex();
251          final int loop(int n) {
252              final LongMutex lock = this.lock;
253              int sum = 0;
# Line 267 | Line 267 | public final class CheckedLockLoops {
267      }
268  
269      private static class FairReentrantLockLoop extends LockLoop {
270 <        final private ReentrantLock lock = new ReentrantLock(true);
270 >        private final ReentrantLock lock = new ReentrantLock(true);
271          final int loop(int n) {
272              final ReentrantLock lock = this.lock;
273              int sum = 0;
# Line 287 | Line 287 | public final class CheckedLockLoops {
287      }
288  
289      private static class ReentrantWriteLockLoop extends LockLoop {
290 <        final private Lock lock = new ReentrantReadWriteLock().writeLock();
290 >        private final Lock lock = new ReentrantReadWriteLock().writeLock();
291          final int loop(int n) {
292              final Lock lock = this.lock;
293              int sum = 0;
# Line 327 | Line 327 | public final class CheckedLockLoops {
327      }
328  
329      private static class SemaphoreLoop extends LockLoop {
330 <        final private Semaphore sem = new Semaphore(1, false);
330 >        private final Semaphore sem = new Semaphore(1, false);
331          final int loop(int n) {
332              final Semaphore sem = this.sem;
333              int sum = 0;
# Line 346 | Line 346 | public final class CheckedLockLoops {
346          }
347      }
348      private static class FairSemaphoreLoop extends LockLoop {
349 <        final private Semaphore sem = new Semaphore(1, true);
349 >        private final Semaphore sem = new Semaphore(1, true);
350          final int loop(int n) {
351              final Semaphore sem = this.sem;
352              int sum = 0;
# Line 366 | Line 366 | public final class CheckedLockLoops {
366      }
367  
368      private static class ReentrantReadWriteLockLoop extends LockLoop {
369 <        final private ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
369 >        private final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
370          final int loop(int n) {
371              final Lock rlock = lock.readLock();
372              final Lock wlock = lock.writeLock();
# Line 401 | Line 401 | public final class CheckedLockLoops {
401  
402  
403      private static class FairReentrantReadWriteLockLoop extends LockLoop {
404 <        final private ReentrantReadWriteLock lock = new ReentrantReadWriteLock(true);
404 >        private final ReentrantReadWriteLock lock = new ReentrantReadWriteLock(true);
405          final int loop(int n) {
406              final Lock rlock = lock.readLock();
407              final Lock wlock = lock.writeLock();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines