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
WaitStrategy
WaitStrategy
. A common use for this is to signal a timeout.waitFor
in interface WaitStrategy
position
- 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()
WaitStrategy
signalAllWhenBlocking
in interface WaitStrategy
Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.