Code example for ReentrantReadWriteLock

Methods: readLock, writeLock

0
			return size() > 50; 
		} 
 
	}; 
 
	private static final ReentrantReadWriteLock readWriteLock = new ReentrantReadWriteLock();
	private static final Lock read  = readWriteLock.readLock();
	private static final Lock write = readWriteLock.writeLock();
 
	/** 
	 *  
	 */ 
	private ImageCache() { 
		super(); 
	} 
 
	public static Bitmap getFromCache(String id){
		read.lock();
		try { 
			if(!cache.containsKey(id))
				return null;