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 hasReadOrWriteLock()
          Check if the current thread holds read or write lock.
 boolean hasWriteLock()
          Check if the current thread holds write 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.


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.


hasReadOrWriteLock

boolean hasReadOrWriteLock()
Check if the current thread holds read or write lock.



Copyright © 2013 Apache Software Foundation. All Rights Reserved.