Class StripedCompositeReadWriteLock

    • Constructor Detail

      • StripedCompositeReadWriteLock

        public StripedCompositeReadWriteLock​(int concurrencyLvl)
        Creates a new instance with given concurrency level.
        Parameters:
        concurrencyLvl - Number of internal read locks.
    • Method Detail

      • isWriteLockedByCurrentThread

        public boolean isWriteLockedByCurrentThread()
        Queries if the write lock is held by the current thread.
        Returns:
        true if the current thread holds the write lock and false otherwise
      • getReadHoldCount

        public int getReadHoldCount()
        Queries the number of reentrant read holds on this lock by the current thread. A reader thread has a hold on a lock for each lock action that is not matched by an unlock action.
        Returns:
        the number of holds on the read lock by the current thread, or zero if the read lock is not held by the current thread