|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjsync.Semaphore
Classical Dijkstra semaphore with wait()
and
signal()
operations.
Constructor Summary | |
Semaphore()
Create semaphore with zero counter value. |
|
Semaphore(int initValue)
Create semaphore with specified non-negative counter value. |
Method Summary | |
void |
signal()
Increment value of the counter. |
void |
waitSemaphore()
Wait for non-zero value of counter. |
boolean |
waitSemaphore(long timeout)
Wait at most timeout miliseconds for non-zero value
of counter. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Semaphore()
public Semaphore(int initValue)
initValue
- initial value of semaphore counterMethod Detail |
public void waitSemaphore()
public boolean waitSemaphore(long timeout)
timeout
miliseconds for non-zero value
of counter.
timeout
- the maximum time to wait in milliseconds.
true
if counter is not zero, false
if wait()
was terminated due to timeout expiration.public void signal()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |