Modifier and Type | Class and Description |
---|---|
static class |
WaitQueue.Standard.AbstractSignal
An abstract signal implementation
TODO: use intrusive linked list
|
WaitQueue.Signal, WaitQueue.Standard
Modifier | Constructor and Description |
---|---|
protected |
Standard() |
Modifier and Type | Method and Description |
---|---|
int |
getWaiting()
Return how many threads are waiting
|
boolean |
hasWaiters()
getWaiting() > 0
|
WaitQueue.Signal |
register()
The calling thread MUST be the thread that uses the signal
|
<V> WaitQueue.Signal |
register(V supplyOnDone,
java.util.function.Consumer<V> receiveOnDone)
The calling thread MUST be the thread that uses the signal.
|
boolean |
signal()
Signal one waiting thread
|
void |
signalAll()
Signal all waiting threads
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
newWaitQueue, waitOnCondition
public WaitQueue.Signal register()
public <V> WaitQueue.Signal register(V supplyOnDone, java.util.function.Consumer<V> receiveOnDone)
public boolean signal()
public void signalAll()
public boolean hasWaiters()
WaitQueue
hasWaiters
in interface WaitQueue
public int getWaiting()
WaitQueue
getWaiting
in interface WaitQueue
Copyright © 2009- The Apache Software Foundation