Code example for ReentrantLock

Methods: locknewConditionunlock

0
		if (pInitialCapacity <= 0) {
			throw new IllegalArgumentException("pInitialCapacity must be greater than 0.");
		} 
 
		final ReentrantLock lock = this.mLock;
		lock.lock();
 
		try { 
			this.mQueues.put(pPriority, new CircularList<T>(pInitialCapacity));
			this.mQueueCapacities.put(pPriority, pCapacity);
			this.mNotFullConditions.put(pPriority, this.mLock.newCondition());
		} finally { 
			lock.unlock();
		} 
	} 
 
	public T peek() { 
		final ReentrantLock lock = this.mLock;
		lock.lock();
 
Stop searching for code, let great code find you!  Add Codota to your java IDE