public interface PointerBarrier extends AutoCloseable
Pointer
and that will wait
to advance it until it is safe to do so
and there are entries available to read. This is used within the RingBuffer.addConsumer(C)
method to provide each consumer
with a valid Pointer
that stays as close as possible behind the ring buffer's Cursor
.Cursor.newBarrier()
Modifier and Type | Method and Description |
---|---|
void |
close()
Signal that this barrier is closed and should return -1 from
waitFor(long) . |
boolean |
isComplete()
Return whether this barrier has completed and should no longer be used.
|
long |
waitFor(long position)
Wait for the given position to be available for consumption.
|
long waitFor(long position) throws InterruptedException, TimeoutException
position
- the sequence to wait forInterruptedException
- if the thread needs awaking on a condition variable.TimeoutException
- if this blocking method times outboolean isComplete()
void close()
waitFor(long)
.close
in interface AutoCloseable
Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.