info.aduna.concurrent.locks
Interface ReadWriteLockManager

All Known Implementing Classes:
ReadPrefReadWriteLockManager, WritePrefReadWriteLockManager

public interface ReadWriteLockManager

A lock manager that manages a multi-read, single-write lock. This lock manager allows multiple read locks to be active at the same time. The write lock is exclusive, meaning that no other read- or write locks may be active at the same time.

Author:
Arjohn Kampman

Method Summary
 Lock getReadLock()
          Gets a read lock.
 Lock getWriteLock()
          Gets an exclusive write lock.
 

Method Detail

getReadLock

Lock getReadLock()
                 throws InterruptedException
Gets a read lock. This method blocks until the read lock is available.

Throws:
InterruptedException - In case the thread requesting the lock was interrupted.

getWriteLock

Lock getWriteLock()
                  throws InterruptedException
Gets an exclusive write lock. This method blocks until the write lock is available.

Throws:
InterruptedException - In case the thread requesting the lock was interrupted.


Copyright © 1997-2008 Aduna. All Rights Reserved.