org.apache.hadoop.hdfs.util
Interface RwLock


public interface RwLock

Read-write lock interface.


Method Summary
 boolean hasReadLock()
          Check if the current thread holds read lock.
 boolean hasWriteLock()
          Check if the current thread holds write lock.
 void longReadLockInterruptibly()
          Acquire the long read lock, unless interrupted while waiting.
 void longReadUnlock()
          Release the long read lock.
 void readLock()
          Acquire read lock.
 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.


longReadLockInterruptibly

void longReadLockInterruptibly()
                               throws InterruptedException
Acquire the long read lock, unless interrupted while waiting. The long read lock should also serve to block all concurrent writers.

Throws:
InterruptedException

longReadUnlock

void longReadUnlock()
Release the long read lock.


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 © 2014 Apache Software Foundation. All Rights Reserved.