|
Agent System POND 1.2 (28.2.2002) | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--FIM.synchronisation.Semaphor
A standard semaphor as defined in books on operating systems.
Negative values are the number of threads waiting, positive values the
number of possible waits without blocking.
Because of a collision with java.lang.Object, the methods are all
prefixed with "Sem": SemWait, SemSignal, SemValue.
Thread
Constructor Summary | |
Semaphor()
Create a new semaphor with a count of 1. |
|
Semaphor(long init)
Create a new semaphor with the provided count. |
Method Summary | |
void |
SemInit(long init)
Re-Initializes the semaphor with the value provided. |
void |
SemSignal()
Send a signal to the Semaphor. |
long |
SemValue()
Returns the current value of the semaphor. |
void |
SemWait()
Waits till the Semaphor is available. |
void |
SemWaitNoInterrupt()
Waits till the Semaphor is available. ATTENTION: Will ignore any interrupts (no interrupt possible; swallows the InterruptedException )
and wait again till finally a SemSignal is done.
|
Methods inherited from class java.lang.Object |
|
Constructor Detail |
public Semaphor()
public Semaphor(long init)
init
- initial value of the semaphorMethod Detail |
public void SemInit(long init)
SemSignal
s and the excess value is
only required for new SemWait
s to not block.init
- the value to initialize the semaphor withpublic long SemValue()
SemWait
will succeed without blockingSemWait
will block till SemSignal
is calledpublic void SemWait() throws InterruptedException
InterruptedException
- if interrupt
is calledThread
public void SemWaitNoInterrupt()
interrupt
possible; swallows the InterruptedException
)
and wait again till finally a SemSignal is done.
No termination in between possible!Thread
public void SemSignal()
|
Agent System POND 1.2 (28.2.2002) | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |