Class OAdaptiveLock

java.lang.Object
com.orientechnologies.common.concur.lock.OAbstractLock
com.orientechnologies.common.concur.lock.OAdaptiveLock
All Implemented Interfaces:
OLock

public class OAdaptiveLock extends OAbstractLock
Adaptive class to handle shared resources. It's configurable specifying if it's running in a concurrent environment and allow o specify a maximum timeout to avoid deadlocks.
Author:
Luca Garulli (l.garulli--(at)--orientdb.com)
  • Constructor Details

    • OAdaptiveLock

      public OAdaptiveLock()
    • OAdaptiveLock

      public OAdaptiveLock(int iTimeout)
    • OAdaptiveLock

      public OAdaptiveLock(boolean iConcurrent)
    • OAdaptiveLock

      public OAdaptiveLock(boolean iConcurrent, int iTimeout, boolean ignoreThreadInterruption)
  • Method Details

    • lock

      public void lock()
    • tryAcquireLock

      public boolean tryAcquireLock()
    • tryAcquireLock

      public boolean tryAcquireLock(long iTimeout, TimeUnit iUnit)
    • unlock

      public void unlock()
    • close

      public void close()
    • isConcurrent

      public boolean isConcurrent()
    • getUnderlying

      public ReentrantLock getUnderlying()
    • isHeldByCurrentThread

      public boolean isHeldByCurrentThread()