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.7 by jsr166, Thu Sep 16 03:57:13 2010 UTC vs.
Revision 1.8 by jsr166, Mon Sep 27 19:15:16 2010 UTC

# Line 121 | Line 121 | public final class UncheckedLockLoops {
121  
122      }
123  
124 <    static abstract class LockLoop implements Runnable {
124 >    abstract static class LockLoop implements Runnable {
125          int value;
126          int checkValue;
127          int iters;
# Line 211 | Line 211 | public final class UncheckedLockLoops {
211      }
212  
213      private static class ReentrantLockLoop extends LockLoop {
214 <        final private ReentrantLock lock = new ReentrantLock();
214 >        private final ReentrantLock lock = new ReentrantLock();
215          final int loop(int n) {
216              final ReentrantLock lock = this.lock;
217              int sum = 0;
# Line 231 | Line 231 | public final class UncheckedLockLoops {
231      }
232  
233      private static class MutexLoop extends LockLoop {
234 <        final private Mutex lock = new Mutex();
234 >        private final Mutex lock = new Mutex();
235          final int loop(int n) {
236              final Mutex lock = this.lock;
237              int sum = 0;
# Line 251 | Line 251 | public final class UncheckedLockLoops {
251      }
252  
253      private static class LongMutexLoop extends LockLoop {
254 <        final private LongMutex lock = new LongMutex();
254 >        private final LongMutex lock = new LongMutex();
255          final int loop(int n) {
256              final LongMutex lock = this.lock;
257              int sum = 0;
# Line 271 | Line 271 | public final class UncheckedLockLoops {
271      }
272  
273      private static class FairReentrantLockLoop extends LockLoop {
274 <        final private ReentrantLock lock = new ReentrantLock(true);
274 >        private final ReentrantLock lock = new ReentrantLock(true);
275          final int loop(int n) {
276              final ReentrantLock lock = this.lock;
277              int sum = 0;
# Line 291 | Line 291 | public final class UncheckedLockLoops {
291      }
292  
293      private static class ReentrantWriteLockLoop extends LockLoop {
294 <        final private Lock lock = new ReentrantReadWriteLock().writeLock();
294 >        private final Lock lock = new ReentrantReadWriteLock().writeLock();
295          final int loop(int n) {
296              final Lock lock = this.lock;
297              int sum = 0;
# Line 331 | Line 331 | public final class UncheckedLockLoops {
331      }
332  
333      private static class SemaphoreLoop extends LockLoop {
334 <        final private Semaphore sem = new Semaphore(1, false);
334 >        private final Semaphore sem = new Semaphore(1, false);
335          final int loop(int n) {
336              final Semaphore sem = this.sem;
337              int sum = 0;
# Line 350 | Line 350 | public final class UncheckedLockLoops {
350          }
351      }
352      private static class FairSemaphoreLoop extends LockLoop {
353 <        final private Semaphore sem = new Semaphore(1, true);
353 >        private final Semaphore sem = new Semaphore(1, true);
354          final int loop(int n) {
355              final Semaphore sem = this.sem;
356              int sum = 0;
# Line 370 | Line 370 | public final class UncheckedLockLoops {
370      }
371  
372      private static class ReentrantReadWriteLockLoop extends LockLoop {
373 <        final private ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
373 >        private final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
374          final int loop(int n) {
375              final Lock rlock = lock.readLock();
376              final Lock wlock = lock.writeLock();
# Line 405 | Line 405 | public final class UncheckedLockLoops {
405  
406  
407      private static class FairReentrantReadWriteLockLoop extends LockLoop {
408 <        final private ReentrantReadWriteLock lock = new ReentrantReadWriteLock(true);
408 >        private final ReentrantReadWriteLock lock = new ReentrantReadWriteLock(true);
409          final int loop(int n) {
410              final Lock rlock = lock.readLock();
411              final Lock wlock = lock.writeLock();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines