Package org.apache.openjpa.slice
Class ReentrantSliceLock
- java.lang.Object
-
- java.util.concurrent.locks.ReentrantLock
-
- org.apache.openjpa.slice.ReentrantSliceLock
-
- All Implemented Interfaces:
java.io.Serializable
,java.util.concurrent.locks.Lock
public class ReentrantSliceLock extends java.util.concurrent.locks.ReentrantLock
A reentrant lock that lets a child to work with the parent's lock.- Author:
- Pinaki Poddar
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ReentrantSliceLock()
ReentrantSliceLock(boolean fair)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
lock()
Locks only for parent thread and let the child use parent's lock.void
unlock()
Unlocks only if parent thread.-
Methods inherited from class java.util.concurrent.locks.ReentrantLock
getHoldCount, getOwner, getQueuedThreads, getQueueLength, getWaitingThreads, getWaitQueueLength, hasQueuedThread, hasQueuedThreads, hasWaiters, isFair, isHeldByCurrentThread, isLocked, lockInterruptibly, newCondition, toString, tryLock, tryLock
-
-
-
-
Method Detail
-
lock
public void lock()
Locks only for parent thread and let the child use parent's lock.- Specified by:
lock
in interfacejava.util.concurrent.locks.Lock
- Overrides:
lock
in classjava.util.concurrent.locks.ReentrantLock
-
unlock
public void unlock()
Unlocks only if parent thread.- Specified by:
unlock
in interfacejava.util.concurrent.locks.Lock
- Overrides:
unlock
in classjava.util.concurrent.locks.ReentrantLock
-
-