Class WaitQueue.Standard
- java.lang.Object
-
- org.apache.cassandra.utils.concurrent.WaitQueue.Standard
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WaitQueue.Standard.AbstractSignal
An abstract signal implementation TODO: use intrusive linked list-
Nested classes/interfaces inherited from interface org.apache.cassandra.utils.concurrent.WaitQueue
WaitQueue.Signal, WaitQueue.Standard
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Standard()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getWaiting()
Return how many threads are waitingboolean
hasWaiters()
getWaiting() > 0WaitQueue.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 threadvoid
signalAll()
Signal all waiting threads
-
-
-
Method Detail
-
register
public WaitQueue.Signal register()
The calling thread MUST be the thread that uses the signal
-
register
public <V> WaitQueue.Signal register(V supplyOnDone, java.util.function.Consumer<V> receiveOnDone)
The calling thread MUST be the thread that uses the signal. If the Signal is waited on, context.stop() will be called when the wait times out, the Signal is signalled, or the waiting thread is interrupted.
-
signal
public boolean signal()
Signal one waiting thread
-
signalAll
public void signalAll()
Signal all waiting threads
-
hasWaiters
public boolean hasWaiters()
Description copied from interface:WaitQueue
getWaiting() > 0- Specified by:
hasWaiters
in interfaceWaitQueue
-
getWaiting
public int getWaiting()
Description copied from interface:WaitQueue
Return how many threads are waiting- Specified by:
getWaiting
in interfaceWaitQueue
- Returns:
- how many threads are waiting
-
-