public class ThreadGate
extends java.lang.Object
Constructor and Description |
---|
ThreadGate() |
Modifier and Type | Method and Description |
---|---|
boolean |
await(long timeout)
Wait for the gate to open.
|
java.lang.Object |
getMessage()
Returns the message object associated with the gate; the
message is just an arbitrary object used to pass information
to the waiting threads.
|
void |
open()
Open the gate and release any waiting threads.
|
void |
setMessage(java.lang.Object msg)
Sets the message object associated with the gate.
|
public void open()
public java.lang.Object getMessage()
public void setMessage(java.lang.Object msg)
msg
- the message object to associate with this gate.public boolean await(long timeout) throws java.lang.InterruptedException
java.lang.InterruptedException
- If the calling thread is interrupted;
the gate still remains closed until opened.Copyright © 2012. All Rights Reserved.