|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jarol.Signal
public class Signal
Signal is a synchronization point, the await()
call causes the
callers (e.g., thread, process, exotask,...) to be suspended until a
signal()
call is performed by an arbitary task.
A SignalException is thrown in the following cases:
(1) signal()
is invoked and there is no thread awaiting. - SignalNotAwaitedException
(2) signal()
is invoked while signaling is in progress (during the wake up phase of awaiting threads).
- SignalDuringSignalingException
(3) await()
is invoked while signaling is in progress. - AwaitDuringSignalingException
(4) the awaiting thread is interrupted (interrupt()
called).
Constructor Summary | |
---|---|
Signal()
Constructs a signal. |
|
Signal(java.lang.String name,
boolean debug)
Creates a signal with a specified name and the debug flag. |
Method Summary | |
---|---|
void |
await()
Causes the caller to be suspended until signal() is called. |
void |
signal()
All callers of await() tasks are resumed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Signal()
public Signal(java.lang.String name, boolean debug)
signal()
("SIGNAL " + name)await()
("AWAIT " + name)signal()
after an await()
("AWAIT " + name + " leaving!")
name
- - The name of the Clock.Method Detail |
---|
public void signal() throws SignalDuringSignalingException, SignalNotAwaitedException
await()
tasks are resumed. A SignalException is thrown, if
a signal is invoked without a caller awaiting or signal occured while signaling
is in progress.
SignalDuringSignalingException
SignalNotAwaitedException
public void await() throws AwaitDuringSignalingException
signal()
is called.
A SignalException is thrown, if an await()
is invoked without while signaling
is in progress or a InterruptedException is caught.
AwaitDuringSignalingException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |