|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectapp.util.Token
public final class Token
A synchronization Token is essentially a binary semaphore,
with acquire()
as the potentially blocking P() operation,
and release()
as the potentially unblocking V() operation.
Method Summary | |
---|---|
void |
acquire()
Acquires this token, blocking if necessary until it is available. |
static Token |
newBlockedToken()
Creates and returns a new token, initially "blocked", i.e. |
static Token |
newUnblockedToken()
Creates and returns a new token, initially "unblocked", i.e. |
void |
release()
Releases this token, possibly unblocking a thread currently attempting to acquire() it. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public final void acquire() throws java.lang.InterruptedException
java.lang.InterruptedException
public final void release() throws java.lang.IllegalStateException
acquire()
it.
java.lang.IllegalStateException
public static final Token newBlockedToken()
public static final Token newUnblockedToken()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |