Code example for ReentrantReadWriteLock

Methods: readLock, writeLock

0
        public final Lock readLock;
 
        public final Lock writeLock;
 
        { 
            final ReadWriteLock readWriteLock = new ReentrantReadWriteLock(true);
            readLock = readWriteLock.readLock();
            writeLock = readWriteLock.writeLock();
        } 
    } 
 
    /** 
     * The active storage providers. 
     */ 
    private final Map<String, StorageProvider> mProviders = new LinkedHashMap<String, StorageProvider>();
 
    /** 
     * Locking data for the active storage providers. 
     */ 
    private final Map<StorageProvider, SynchronizationAid> mProviderLocks = new IdentityHashMap<StorageProvider, SynchronizationAid>();