Class WaitQueue.Standard
- java.lang.Object
-
- org.apache.cassandra.utils.concurrent.WaitQueue.Standard
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWaitQueue.Standard.AbstractSignalAn 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 protectedStandard()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetWaiting()Return how many threads are waitingbooleanhasWaiters()getWaiting() > 0WaitQueue.Signalregister()The calling thread MUST be the thread that uses the signal<V> WaitQueue.Signalregister(V supplyOnDone, java.util.function.Consumer<V> receiveOnDone)The calling thread MUST be the thread that uses the signal.booleansignal()Signal one waiting threadvoidsignalAll()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:WaitQueuegetWaiting() > 0- Specified by:
hasWaitersin interfaceWaitQueue
-
getWaiting
public int getWaiting()
Description copied from interface:WaitQueueReturn how many threads are waiting- Specified by:
getWaitingin interfaceWaitQueue- Returns:
- how many threads are waiting
-
-