|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.norther.tammi.acorn.util.concurrent.Mutex
public class Mutex
A non-reentrant mutual exclusion lock.
| Constructor Summary | |
|---|---|
Mutex()
|
|
| Method Summary | |
|---|---|
int |
getQueueLength()
Gets the number of threads waiting to acquire this lock. |
boolean |
hasQueuedThreads()
Queries whether any threads are waiting to acquire this lock. |
void |
lock()
|
void |
lockInterruptibly()
|
Condition |
newCondition()
|
boolean |
tryLock()
|
boolean |
tryLock(long timeout,
TimeUnit unit)
|
void |
unlock()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Mutex()
| Method Detail |
|---|
public void lock()
lock in interface Lockpublic boolean tryLock()
tryLock in interface Lockpublic void unlock()
unlock in interface Lockpublic Condition newCondition()
newCondition in interface Lock
public void lockInterruptibly()
throws InterruptedException
lockInterruptibly in interface LockInterruptedException
public boolean tryLock(long timeout,
TimeUnit unit)
throws InterruptedException
tryLock in interface LockInterruptedExceptionpublic final boolean hasQueuedThreads()
Note that because of cancellations, a true return does not guarantee that any other thread will ever acquire this lock.
public final int getQueueLength()
Note that the value is only an estimate because the number of threads may change dynamically while this method is executing.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||