Class GridSpinReadWriteLock

    • Constructor Detail

      • GridSpinReadWriteLock

        public GridSpinReadWriteLock()
    • Method Detail

      • readLock

        public void readLock()
        Acquires read lock.
      • tryReadLock

        public boolean tryReadLock()
        Tries to acquire read lock.
        Returns:
        true if acquired.
      • readUnlock

        public void readUnlock()
        Read unlock.
      • writeLock

        public void writeLock()
        Acquires write lock.
      • writeLock0

        public void writeLock0()
        Acquires write lock without sleeping between unsuccessful attempts.
      • writeLockedByCurrentThread

        public boolean writeLockedByCurrentThread()
        Returns:
        True if blocked by current thread.
      • tryWriteLock

        public boolean tryWriteLock()
        Tries to acquire write lock.
        Returns:
        True if write lock has been acquired.
      • tryWriteLock

        public boolean tryWriteLock​(long timeout,
                                    TimeUnit unit)
                             throws InterruptedException
        Parameters:
        timeout - Timeout.
        unit - Unit.
        Returns:
        True if write lock has been acquired.
        Throws:
        InterruptedException - If interrupted.
      • writeUnlock

        public void writeUnlock()
        Releases write lock.