|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.github.libxjava.concurrent.ReentrantLock
public final class ReentrantLock
Implementation of an "unfair" reentrant lock.
| Nested Class Summary | |
|---|---|
class |
ReentrantLock.Condition
|
| Constructor Summary | |
|---|---|
ReentrantLock()
|
|
| Method Summary | |
|---|---|
protected boolean |
doAcquire(int count)
|
protected int |
doReleaseFully()
|
int |
getCount()
Returns the state of the internal acquisition counter. |
boolean |
isOwner()
Checks whether the current thread is the owner of this lock. |
void |
lock()
Blocks until this lock becomes available. |
void |
lockInterruptibly()
Blocks until this lock becomes available. |
ReentrantLock.Condition |
newCondition()
|
boolean |
tryLock()
Tries to obtain the ownership of this lock and returns immediately. |
void |
unlock()
Decrements the internal acquisition counter for this lock. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ReentrantLock()
| Method Detail |
|---|
public void lock()
lockInterruptibly()
public void lockInterruptibly()
throws InterruptedException
Ensure that you release this lock as often as you
acquired it!
InterruptedException will
be thrown.
InterruptedExceptionpublic boolean tryLock()
true if acquisition was successful and false otherwise.
public void unlock()
throws IllegalMonitorStateException
IllegalMonitorStateException will be thrown.
IllegalMonitorStateExceptionpublic boolean isOwner()
public int getCount()
public ReentrantLock.Condition newCondition()
protected int doReleaseFully()
protected boolean doAcquire(int count)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||