public class ThreadGate extends Object
| Constructor and Description |
|---|
ThreadGate() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
await(long timeout)
Wait for the gate to open.
|
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(Object msg)
Sets the message object associated with the gate.
|
public void open()
public Object getMessage()
public void setMessage(Object msg)
msg - the message object to associate with this gate.public boolean await(long timeout)
throws InterruptedException
InterruptedException - If the calling thread is interrupted;
the gate still remains closed until opened.Copyright © 2006–2022 The Apache Software Foundation. All rights reserved.