Class AbstractReadWriteLockManager

    • Constructor Detail

      • AbstractReadWriteLockManager

        public AbstractReadWriteLockManager()
        Creates a MultiReadSingleWriteLockManager.
      • AbstractReadWriteLockManager

        public AbstractReadWriteLockManager​(boolean trackLocks)
        Creates a new MultiReadSingleWriteLockManager, optionally with lock tracking enabled.
        Parameters:
        trackLocks - Controls whether the lock manager will keep track of active locks. Enabling lock tracking will add some overhead, but can be very useful for debugging.
    • Method Detail

      • isWriterActive

        protected boolean isWriterActive()
        If a writer is active
      • isReaderActive

        protected boolean isReaderActive()
        If one or more readers are active
      • createReadLock

        protected Lock createReadLock()
        Creates a new Lock for reading and increments counter for active readers. The lock is tracked if lock tracking is enabled. This method is not thread safe itself, the calling method is expected to handle synchronization issues.
        Returns:
        a read lock.
      • createWriteLock

        protected Lock createWriteLock()
        Creates a new Lock for writing. The lock is tracked if lock tracking is enabled. This method is not thread safe itself for performance reasons, the calling method is expected to handle synchronization issues.
        Returns:
        a write lock.