diff --git a/tooling/pipeline/includes/concurrency/bounded_channel.h b/tooling/pipeline/includes/concurrency/bounded_channel.h index 0c5c2e06..71dda2cf 100644 --- a/tooling/pipeline/includes/concurrency/bounded_channel.h +++ b/tooling/pipeline/includes/concurrency/bounded_channel.h @@ -26,45 +26,45 @@ */ template class BoundedChannel { - // Internal state — all access must be guarded by mutex_. + // Internal state — all access must be guarded by mutex_. - std::queue queue_; + std::queue queue_; - std::mutex mutex_; + std::mutex mutex_; - std::condition_variable not_full_; + std::condition_variable not_full_; - std::condition_variable not_empty_; + std::condition_variable not_empty_; - std::size_t capacity_; + std::size_t capacity_; - bool closed_ = false; + bool closed_ = false; - public: - /** - * @brief Construct a bounded channel with the given capacity. - * @param capacity Maximum number of items the channel may hold. - */ - explicit BoundedChannel(std::size_t capacity) : capacity_(capacity) {} + public: + /** + * @brief Construct a bounded channel with the given capacity. + * @param capacity Maximum number of items the channel may hold. + */ + explicit BoundedChannel(std::size_t capacity) : capacity_(capacity) {} - /** - * @brief Send an item into the channel. Blocks when the channel is full. - * @param item Move-only item to enqueue. - */ - void Send(T item); + /** + * @brief Send an item into the channel. Blocks when the channel is full. + * @param item Move-only item to enqueue. + */ + void Send(T item); - /** - * @brief Receive an item from the channel. Blocks when the channel is - * empty. - * @return std::optional containing the item, or std::nullopt when the - * channel is closed and drained. - */ - std::optional Receive(); + /** + * @brief Receive an item from the channel. Blocks when the channel is + * empty. + * @return std::optional containing the item, or std::nullopt when the + * channel is closed and drained. + */ + std::optional Receive(); - /** - * @brief Close the channel and unblock all waiting threads. Idempotent. - */ - void Close(); + /** + * @brief Close the channel and unblock all waiting threads. Idempotent. + */ + void Close(); }; // Include the template implementation