sequenceBarrier.clearAlert();
sequenceBarrier.clearAlert();
@Test public void shouldSetAndClearAlertStatus() { SequenceBarrier sequenceBarrier = ringBuffer.newBarrier(); assertFalse(sequenceBarrier.isAlerted()); sequenceBarrier.alert(); assertTrue(sequenceBarrier.isAlerted()); sequenceBarrier.clearAlert(); assertFalse(sequenceBarrier.isAlerted()); }
sequenceBarrier.clearAlert();
sequenceBarrier.clearAlert();
/** * It is ok to have another thread rerun this method after a halt(). * * @throws IllegalStateException if this object instance is already running in a thread */ @Override public void run() { if (running.compareAndSet(IDLE, RUNNING)) { sequenceBarrier.clearAlert(); } else if (running.get() == RUNNING) { throw new IllegalStateException("Thread is already running"); } nextSequence = sequence.get() + 1L; }
/** * It is ok to have another thread rerun this method after a halt(). * * @throws IllegalStateException if this object instance is already running in a thread */ @Override public void run() { if (running.compareAndSet(IDLE, RUNNING)) { sequenceBarrier.clearAlert(); try { if (running.get() == RUNNING) { try (AffinityLock cpuLock = AffinityLock.acquireLock()) { processEvents(); } } } finally { running.set(IDLE); } } else { // This is a little bit of guess work. The running state could of changed to HALTED by // this point. However, Java does not have compareAndExchange which is the only way // to get it exactly correct. if (running.get() == RUNNING) { throw new IllegalStateException("Thread is already running"); } } }
/** * It is ok to have another thread rerun this method after a halt(). * * @throws IllegalStateException if this object instance is already running in a thread */ @Override public void run() { if (running.compareAndSet(IDLE, RUNNING)) { sequenceBarrier.clearAlert(); try { if (running.get() == RUNNING) { try (AffinityLock cpuLock = AffinityLock.acquireLock()) { processEvents(); } } } finally { running.set(IDLE); } } else { // This is a little bit of guess work. The running state could of changed to HALTED by // this point. However, Java does not have compareAndExchange which is the only way // to get it exactly correct. if (running.get() == RUNNING) { throw new IllegalStateException("Thread is already running"); } } }
sequenceBarrier.clearAlert();
sequenceBarrier.clearAlert();
sequenceBarrier.clearAlert();
sequenceBarrier.clearAlert();
sequenceBarrier.clearAlert();
barrier.clearAlert(); break; barrier.clearAlert();
sequenceBarrier.clearAlert();
sequence.set(cursor - 1l); processor.barrier.clearAlert();