Class SafeLockImpl

java.lang.Object
com.pnfsoftware.jeb.util.concurrent.SafeLockImpl
All Implemented Interfaces:
ISafeLock

@Ser public class SafeLockImpl extends Object implements ISafeLock
Standard implementation of a safe lock, using a serializable reentrant read-write lock. It is highly recommended to use this lock through the safe interface ISafeLock. Direct use of non-auto-closable methods is not recommended.
See Also:
  • Constructor Details

    • SafeLockImpl

      public SafeLockImpl()
  • Method Details

    • getInternalLock

      public ReentrantReadWriteLock getInternalLock()
    • lockWrite

      public void lockWrite()
    • unlockWrite

      public void unlockWrite()
    • lockRead

      public void lockRead()
    • unlockRead

      public void unlockRead()
    • debugFormatStatus

      public String debugFormatStatus()
    • lock

      public void lock(boolean forWriting)
    • unlock

      public void unlock(boolean forWriting)
    • ro

      public ACLock ro()
      Description copied from interface: ISafeLock
      Create an auto-closable read-only lock.
      Specified by:
      ro in interface ISafeLock
      Returns:
    • rw

      public ACLock rw()
      Description copied from interface: ISafeLock
      Create an auto-closable read-write lock.
      Specified by:
      rw in interface ISafeLock
      Returns: