Class ReentrantReadWriteLockWithTracking

  • All Implemented Interfaces:
    ReadWriteLock

    public class ReentrantReadWriteLockWithTracking
    extends Object
    implements ReadWriteLock
    ReentrantReadWriteLock adapter with readLock tracking.
    • Constructor Detail

      • ReentrantReadWriteLockWithTracking

        public ReentrantReadWriteLockWithTracking​(IgniteLogger log,
                                                  long readLockThreshold)
        ReentrantRWLock wrapper, provides additional trace info on ReentrantReadWriteLockWithTracking.ReadLockWithTracking.unlock() method, if someone holds the lock more than readLockThreshold.
        Parameters:
        log - Ignite logger.
        readLockThreshold - ReadLock threshold timeout.
      • ReentrantReadWriteLockWithTracking

        public ReentrantReadWriteLockWithTracking()
        Delegator implementation.
    • Method Detail

      • lockWaitThreshold

        public long lockWaitThreshold()
      • 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
      • getReadLockCount

        public int getReadLockCount()
        Queries the number of read locks held for this lock. This method is designed for use in monitoring system state, not for synchronization control.
        Returns:
        the number of read locks held