Package org.postgresql.jdbc
Class ResourceLock
java.lang.Object
java.util.concurrent.locks.ReentrantLock
org.postgresql.jdbc.ResourceLock
- All Implemented Interfaces:
- Serializable,- AutoCloseable,- Lock
Extends a ReentrantLock for use in try-with-resources block.
 
Example use
   try (ResourceLock ignore = lock.obtain()) {
     // do something while holding the resource lock
   }
 - See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryMethods inherited from class java.util.concurrent.locks.ReentrantLockgetHoldCount, getOwner, getQueuedThreads, getQueueLength, getWaitingThreads, getWaitQueueLength, hasQueuedThread, hasQueuedThreads, hasWaiters, isFair, isHeldByCurrentThread, isLocked, lock, lockInterruptibly, newCondition, toString, tryLock, tryLock, unlock
- 
Constructor Details- 
ResourceLockpublic ResourceLock()
 
- 
- 
Method Details- 
obtainObtain a lock and return the ResourceLock for use in try-with-resources block.
- 
closepublic void close()Unlock on exit of try-with-resources block.- Specified by:
- closein interface- AutoCloseable
 
 
-