18#ifndef _DECAF_UTIL_CONCURRENT_LOCKS_REENTRANTLOCK_H_
19#define _DECAF_UTIL_CONCURRENT_LOCKS_REENTRANTLOCK_H_
89 ReentrantLock(
const ReentrantLock& );
90 ReentrantLock& operator= (
const ReentrantLock& );
A Thread is a concurrent unit of execution.
Definition Thread.h:64
The root interface in the collection hierarchy.
Definition Collection.h:69
A TimeUnit represents time durations at a given unit of granularity and provides utility methods to c...
Definition TimeUnit.h:62
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
virtual void lockInterruptibly()
Acquires the lock unless the current thread is interrupted.
int getHoldCount() const
Queries the number of holds on this lock by the current thread.
bool hasWaiters(Condition *condition) const
Returns true if there are any threads that are currently waiting on the given Condition object,...
bool isHeldByCurrentThread() const
Queries if this lock is held by the current thread.
virtual void unlock()
Attempts to release this lock.
decaf::util::Collection< decaf::lang::Thread * > * getQueuedThreads() const
Creates and returns a new Collection object that contains a best effort snapshot of the threads that ...
int getQueueLength() const
Gets an estimated count of the number of threads that are currently waiting to acquire,...
virtual Condition * newCondition()
Returns a Condition instance for use with this Lock instance.
virtual void lock()
Acquires the lock.
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 ...
decaf::lang::Thread * getOwner() const
Returns the thread that currently owns this lock, or NULL if not owned.
bool isLocked() const
Queries if this lock is held by any 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 bool tryLock(long long time, const TimeUnit &unit)
Acquires the lock if it is not held by another thread within the given waiting time and the current t...
bool isFair() const
Returns true if this lock has fairness set true.
bool hasQueuedThreads() const
std::string toString() const
Returns a string identifying this lock, as well as its lock state.
ReentrantLock(bool fair)
Create a new ReentrantLock instance with the specified locking semantics.
ReentrantLock()
Create a new ReentrantLock instance with unfair locking semantics.
bool hasQueuedThread(decaf::lang::Thread *thread) const
virtual bool tryLock()
Acquires the lock only if it is not held by another thread at the time of invocation.
#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