docs: the acquire() guard says what it actually guards, now that the drain sits outside it
This commit is contained in:
1 parent
d6afdfef9f
commit
b32987d7e0
1 file changed
+2
-1
+2
-1
@@ -31,6 +31,8 @@ ChannelBuffer::ChannelBuffer(std::shared_ptr<const plot::data::RingBuffer<f32>>
|
|||||||
|
|
||||||
void ChannelBuffer::acquire() noexcept {
|
void ChannelBuffer::acquire() noexcept {
|
||||||
const u64 produced = values_->produced();
|
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_) {
|
if (produced > published_) {
|
||||||
// A producer that lapped this ring -- a long trigger wait, or a store that was
|
// 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:
|
// 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
|
// 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
|
// way the published window stays coherent (an empty or garbled window is what
|
||||||
// "the trace disappeared" looks like from outside).
|
// "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()) {
|
if (produced - published_ > values_->capacity()) {
|
||||||
published_ = 0;
|
published_ = 0;
|
||||||
pyramid_.clear();
|
pyramid_.clear();
|
||||||
|
|||||||
Reference in new issue
Block a user