Code example for ReadWriteLock

Methods: readLock, writeLock

0
 
    /** The size of the cache */ 
    private final int lruSize;
 
    private final ReadWriteLock rwLock = new ReentrantReadWriteLock();
    private final Lock readLock = rwLock.readLock();
    private final Lock writeLock = rwLock.writeLock();
 
    /** 
     * The file cache 
     */ 
    private class MyLRUMap extends LRUMap /* implements Map<FileName, FileObject> */ 
    { 
        /** 
         * serialVersionUID format is YYYYMMDD for the date of the last binary change. 
         */ 
        private static final long serialVersionUID = 20101208L;
 
        /** The FileSystem */ 
        private final FileSystem filesystem;