Class StampedLongAdderLockManager

java.lang.Object
org.eclipse.rdf4j.common.concurrent.locks.StampedLongAdderLockManager

public class StampedLongAdderLockManager extends Object
A lightweight read/write lock manager that avoids allocating per-lock objects. Readers are tracked using two LongAdders while writers rely on a StampedLock. The read-lock method returns a constant stamp (READ_LOCK_STAMP) and writers receive the stamp produced by the underlying StampedLock.
  • Field Details

    • READ_LOCK_STAMP

      public static final long READ_LOCK_STAMP
      Stamp returned to callers holding a read lock. Passing any other value to unlockRead(long) is considered an illegal monitor state.
      See Also:
  • Constructor Details

    • StampedLongAdderLockManager

      public StampedLongAdderLockManager()
    • StampedLongAdderLockManager

      public StampedLongAdderLockManager(int writePreference, int tryWriteLockMillis)
  • Method Details