Class ReentrantSliceLock

java.lang.Object
java.util.concurrent.locks.ReentrantLock
org.apache.openjpa.slice.ReentrantSliceLock
All Implemented Interfaces:
Serializable, Lock

public class ReentrantSliceLock extends ReentrantLock
A reentrant lock that lets a child to work with the parent's lock.
Author:
Pinaki Poddar
See Also:
  • Constructor Details

    • ReentrantSliceLock

      public ReentrantSliceLock()
    • ReentrantSliceLock

      public ReentrantSliceLock(boolean fair)
  • Method Details

    • lock

      public void lock()
      Locks only for parent thread and let the child use parent's lock.
      Specified by:
      lock in interface Lock
      Overrides:
      lock in class ReentrantLock
    • unlock

      public void unlock()
      Unlocks only if parent thread.
      Specified by:
      unlock in interface Lock
      Overrides:
      unlock in class ReentrantLock