public class BlockingWaitStrategy extends Object implements WaitStrategy
WaitStrategy that blocks the current thread until an entry is available for consumption. This implementation uses
Java locks and conditions.| Constructor and Description |
|---|
BlockingWaitStrategy() |
| Modifier and Type | Method and Description |
|---|---|
void |
signalAllWhenBlocking()
Signal all components that want to be notified that the pointer has advanced.
|
long |
waitFor(long position,
Pointer pointer,
Pointer dependentPointer,
PointerBarrier barrier)
Wait for the given position to be available.
|
public long waitFor(long position,
Pointer pointer,
Pointer dependentPointer,
PointerBarrier barrier)
throws InterruptedException
WaitStrategyWaitStrategy. A common use for this is to signal a timeout.waitFor in interface WaitStrategyposition - the desired positionpointer - the main pointer from ringbuffer. Wait/notify strategies will need this as it's the only sequence that is
also notified upon update.dependentPointer - on which to wait.barrier - the processor is waiting on.InterruptedException - if the thread is interrupted.public void signalAllWhenBlocking()
WaitStrategysignalAllWhenBlocking in interface WaitStrategyCopyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.