commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1038059 - /commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/cache/LRUFilesCache.java
Date Tue, 23 Nov 2010 11:19:03 GMT
Author: sebb
Date: Tue Nov 23 11:19:02 2010
New Revision: 1038059

URL: http://svn.apache.org/viewvc?rev=1038059&view=rev
Log:
Locks must be final to ensure safe publication across threads

Modified:
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/cache/LRUFilesCache.java

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/cache/LRUFilesCache.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/cache/LRUFilesCache.java?rev=1038059&r1=1038058&r2=1038059&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/cache/LRUFilesCache.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/cache/LRUFilesCache.java
Tue Nov 23 11:19:02 2010
@@ -57,9 +57,9 @@ public class LRUFilesCache extends Abstr
     /** The size of the cache */
     private final int lruSize;
 
-    private ReadWriteLock rwLock = new ReentrantReadWriteLock();
-    private Lock readLock = rwLock.readLock();
-    private Lock writeLock = rwLock.writeLock();
+    private final ReadWriteLock rwLock = new ReentrantReadWriteLock();
+    private final Lock readLock = rwLock.readLock();
+    private final Lock writeLock = rwLock.writeLock();
 
     /**
      * The file cache



Mime
View raw message