Skip to content

Commit

Permalink
SingleProducerSequencer: update next(n) to not block forever when n >…
Browse files Browse the repository at this point in the history
… bufferSize.

Fixes GitHub issue Abc-Arbitrage#10
  • Loading branch information
oktal committed Aug 11, 2020
1 parent 29d8069 commit 4194602
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Disruptor/SingleProducerSequencer.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ namespace Disruptor
*/
std::int64_t next(std::int32_t n) override
{
if (n < 1)
if (n < 1 || n > this->m_bufferSize)
{
DISRUPTOR_THROW_ARGUMENT_EXCEPTION("n must be > 0");
DISRUPTOR_THROW_ARGUMENT_EXCEPTION("n must be > 0 and < bufferSize");
}

auto nextValue = m_fields.nextValue;
Expand Down

0 comments on commit 4194602

Please sign in to comment.