From 3713c50c4777d437020ee4ce7f8602df97847523 Mon Sep 17 00:00:00 2001 From: Fabian Posch Date: Tue, 9 Jan 2024 21:29:22 -0500 Subject: [PATCH] add function to stop threads and make queue empty publicly accessible --- include/actsim_agent/task_interface.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/actsim_agent/task_interface.hpp b/include/actsim_agent/task_interface.hpp index 8cd2573..ae8762b 100644 --- a/include/actsim_agent/task_interface.hpp +++ b/include/actsim_agent/task_interface.hpp @@ -53,12 +53,13 @@ class TaskInterface { bool fresh_buffer_full(); bool running() { return !this->stop_flag.load(std::memory_order_relaxed); }; - - private: + void stop() { this->stop_flag.store(false, std::memory_order_relaxed); }; bool fresh_queue_empty(); bool finished_queue_empty(); + private: + size_t buffer_size; std::queue> fresh_queue;