From b32987d7e0e70328388811ec3b0cfc658964f5ef Mon Sep 17 00:00:00 2001 From: Martino Ferrari Date: Thu, 8 Oct 2026 19:52:16 +0200 Subject: [PATCH] docs: the acquire() guard says what it actually guards, now that the drain sits outside it --- src/channel.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/channel.cpp b/src/channel.cpp index e486d07..aa8fd9e 100644 --- a/src/channel.cpp +++ b/src/channel.cpp @@ -31,6 +31,8 @@ ChannelBuffer::ChannelBuffer(std::shared_ptr> void ChannelBuffer::acquire() noexcept { const u64 produced = values_->produced(); + // Nothing new skips the append pass only: the backfill drain at the end of this function + // runs either way, because a late packet can land in a frame interval that pushed nothing. if (produced > published_) { // A producer that lapped this ring -- a long trigger wait, or a store that was // not being published for a while -- makes the incremental append meaningless: @@ -38,7 +40,6 @@ void ChannelBuffer::acquire() noexcept { // Rebuilding from the retained window is O(capacity) once, and it is the only // way the published window stays coherent (an empty or garbled window is what // "the trace disappeared" looks like from outside). - // Nothing new; still allow the window to slide if another reader dropped it. if (produced - published_ > values_->capacity()) { published_ = 0; pyramid_.clear();