|
VIBE v5.1.6
Search Engine
|
Classes | |
| interface | SimpleLock |
Public Member Functions | |
| MultiReaderLock () | |
| SimpleLock | readLock () |
| SimpleLock | writeLock () |
| int | readers () |
| int | writers () |
| boolean | isActiveWriter () |
Maintains a pair of associated locks, one for read-only operations and one for writing. The read lock may be held simultaneously by multiple reader threads, so long as there are no writers. The write lock is exclusive. The active writer is able to acquire read or write locks as long as it is active.
| edu.usfca.cs272.MultiReaderLock.MultiReaderLock | ( | ) |
Initializes a new simple read/write lock.
| boolean edu.usfca.cs272.MultiReaderLock.isActiveWriter | ( | ) |
Determines whether the thread running this code and the writer thread are in fact the same thread.
| int edu.usfca.cs272.MultiReaderLock.readers | ( | ) |
Returns the number of active readers.
| SimpleLock edu.usfca.cs272.MultiReaderLock.readLock | ( | ) |
Returns the reader lock.
| SimpleLock edu.usfca.cs272.MultiReaderLock.writeLock | ( | ) |
Returns the writer lock.
| int edu.usfca.cs272.MultiReaderLock.writers | ( | ) |
Returns the number of active writers.