Top Description Fields Constructors Methods
org.apache.commons.pool2.impl

pack-priv Class InterruptibleReentrantLock

extends ReentrantLock
Class Inheritance
Imports
java.util.concurrent.locks.Condition, .ReentrantLock

This sub-class was created to expose the waiting threads so that they can be interrupted when the pool using the queue that uses this lock is closed. The class is intended for internal use only.

This class is intended to be thread-safe.

Since
2.0

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public
InterruptibleReentrantLock(final boolean
true means threads should acquire contended locks as if waiting in a FIFO queue
fairness
)

Constructs a new InterruptibleReentrantLock with the given fairness policy.

Method Summary

Modifier and TypeMethod and Description
public void
interruptWaiters(final Condition
the condition on which the threads are waiting.
condition
)

Interrupts the threads that are waiting on a specific condition

Inherited from java.util.concurrent.locks.ReentrantLock:
getHoldCountgetOwnergetQueuedThreadsgetQueueLengthgetWaitingThreadsgetWaitQueueLengthhasQueuedThreadhasQueuedThreadshasWaitersisFairisHeldByCurrentThreadisLockedlocklockInterruptiblynewConditiontoStringtryLocktryLockunlock

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.util.concurrent.locks.ReentrantLock.serialVersionUID.

Constructor Detail

InterruptibleReentrantLockback to summary
public InterruptibleReentrantLock(final boolean fairness)

Constructs a new InterruptibleReentrantLock with the given fairness policy.

Parameters
fairness:boolean

true means threads should acquire contended locks as if waiting in a FIFO queue

Method Detail

interruptWaitersback to summary
public void interruptWaiters(final Condition condition)

Interrupts the threads that are waiting on a specific condition

Parameters
condition:Condition

the condition on which the threads are waiting.