18#ifndef _DECAF_UTIL_CONCURRENT_LOCKS_REENTRANTREADWRITELOCK_H_
19#define _DECAF_UTIL_CONCURRENT_LOCKS_REENTRANTREADWRITELOCK_H_
32 class ReentrantReadWriteLockImpl;
41 ReentrantReadWriteLockImpl* impl;
45 ReentrantReadWriteLock(
const ReentrantReadWriteLock&);
46 ReentrantReadWriteLock& operator=(
const ReentrantReadWriteLock&);
A Thread is a concurrent unit of execution.
Definition Thread.h:64
The root interface in the collection hierarchy.
Definition Collection.h:69
Condition factors out the Mutex monitor methods (wait, notify and notifyAll) into distinct objects to...
Definition Condition.h:132
Lock implementations provide more extensive locking operations than can be obtained using synchronize...
Definition Lock.h:99
A ReadWriteLock maintains a pair of associated locks, one for read-only operations and one for writin...
Definition ReadWriteLock.h:90
bool hasQueuedThreads() const
Queries whether any threads are waiting to acquire the read or write lock.
bool hasQueuedThread(decaf::lang::Thread *thread) const
Queries whether the given thread is waiting to acquire either the read or write lock.
decaf::util::Collection< decaf::lang::Thread * > * getQueuedReaderThreads() const
Returns a collection containing threads that may be waiting to acquire the read lock.
virtual ~ReentrantReadWriteLock()
int getReadLockCount() const
Queries the number of read locks held for this lock.
decaf::lang::Thread * getOwner() const
Returns the thread that currently owns the write lock, or NULL if not owned.
bool isWriteLocked() const
Queries if the write lock is held by any thread.
virtual decaf::util::concurrent::locks::Lock & writeLock()
Returns the lock used for writing.the lock used for writing.
bool isFair() const
Returns true if this lock has fairness set true.
decaf::util::Collection< decaf::lang::Thread * > * getQueuedThreads() const
Returns a collection containing threads that may be waiting to acquire either the read or write lock.
int getQueueLength() const
Returns an estimate of the number of threads waiting to acquire either the read or write lock.
int getReadHoldCount() const
Queries the number of reentrant read holds on this lock by the current thread.
int getWaitQueueLength(Condition *condition) const
Gets an estimated count of the number of threads that are currently waiting on the given Condition ob...
virtual decaf::util::concurrent::locks::Lock & readLock()
Returns the lock used for reading.the lock used for reading.
decaf::util::Collection< decaf::lang::Thread * > * getQueuedWriterThreads() const
Returns a collection containing threads that may be waiting to acquire the write lock.
std::string toString() const
Returns a string identifying this lock, as well as its lock state.
bool hasWaiters(Condition *condition) const
Queries whether any threads are waiting on the given condition associated with the write lock.
int getWriteHoldCount() const
Queries the number of reentrant write holds on this lock by the current thread.
bool isWriteLockedByCurrentThread() const
Queries if the write lock is held by the current thread.
decaf::util::Collection< decaf::lang::Thread * > * getWaitingThreads(Condition *condition) const
Creates and returns a new Collection object that contains all the threads that may be waiting on the ...
ReentrantReadWriteLock(bool fair)
Creates a new ReentrantReadWriteLock with the given fairness policy.
ReentrantReadWriteLock()
Creates a new ReentrantReadWriteLock with the default ordering property of Not-Fair.
#define DECAF_API
Definition Config.h:29
Definition AbstractOwnableSynchronizer.h:29
Definition AbstractExecutorService.h:28
Definition AbstractCollection.h:33
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition AprPool.h:25