Class InterruptibleReentrantLock

java.lang.Object
java.util.concurrent.locks.ReentrantLock
org.datanucleus.store.rdbms.datasource.dbcp2.pool2.impl.InterruptibleReentrantLock
All Implemented Interfaces:
Serializable, Lock

class InterruptibleReentrantLock extends 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 Details

  • Constructor Details

    • InterruptibleReentrantLock

      public InterruptibleReentrantLock(boolean fairness)
      Create a new InterruptibleReentrantLock with the given fairness policy.
      Parameters:
      fairness - true means threads should acquire contended locks as if waiting in a FIFO queue
  • Method Details

    • interruptWaiters

      public void interruptWaiters(Condition condition)
      Interrupt the threads that are waiting on a specific condition
      Parameters:
      condition - the condition on which the threads are waiting.