org.apache.hadoop.hdfs.util

## Interface RwLock

-     public interface RwLock

  Read-write lock interface.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `hasReadLock()` Check if the current thread holds read lock.
    `boolean` | `hasWriteLock()` Check if the current thread holds write lock.
    `void` | `readLock()` Acquire read lock.
    `void` | `readLockInterruptibly()` Acquire read lock, unless interrupted while waiting
    `void` | `readUnlock()` Release read lock.
    `void` | `writeLock()` Acquire write lock.
    `void` | `writeLockInterruptibly()` Acquire write lock, unless interrupted while waiting
    `void` | `writeUnlock()` Release write lock.

- - ### Method Detail

    - #### readLock

          void readLock()

      Acquire read lock.

    - #### readLockInterruptibly

          void readLockInterruptibly()
                              throws InterruptedException

      Acquire read lock, unless interrupted while waiting
      Throws:
        `InterruptedException`

    - #### readUnlock

          void readUnlock()

      Release read lock.

    - #### hasReadLock

          boolean hasReadLock()

      Check if the current thread holds read lock.

    - #### writeLock

          void writeLock()

      Acquire write lock.

    - #### writeLockInterruptibly

          void writeLockInterruptibly()
                               throws InterruptedException

      Acquire write lock, unless interrupted while waiting
      Throws:
        `InterruptedException`

    - #### writeUnlock

          void writeUnlock()

      Release write lock.

    - #### hasWriteLock

          boolean hasWriteLock()

      Check if the current thread holds write lock.

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.