From 813012a65d0e280f7d24ab595da707389e12818f Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 5 Jan 2026 14:53:42 -1000 Subject: [PATCH] remove dead code --- esphome/components/logger/task_log_buffer_host.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/esphome/components/logger/task_log_buffer_host.h b/esphome/components/logger/task_log_buffer_host.h index b9ada2d90d..aa60fde6b1 100644 --- a/esphome/components/logger/task_log_buffer_host.h +++ b/esphome/components/logger/task_log_buffer_host.h @@ -96,14 +96,12 @@ class TaskLogBufferHost { size_t slot_count_; // Number of slots // Lock-free indices using atomics - // We use a simple approach: write_index_ is where the next write will go, - // read_index_ is where the next read will come from - std::atomic write_index_{0}; // Next slot to write to - std::atomic read_index_{0}; // Next slot to read from - std::atomic commit_index_{0}; // Last committed write - - // For thread-safe slot acquisition + // - reserve_index_: Next slot to reserve (producers CAS this to claim slots) + // - write_index_: Boundary of committed/ready slots (consumer reads up to this) + // - read_index_: Next slot to read (only consumer modifies this) std::atomic reserve_index_{0}; // Next slot to reserve for writing + std::atomic write_index_{0}; // Last committed slot boundary + std::atomic read_index_{0}; // Next slot to read from }; } // namespace esphome::logger