add function to stop threads and make queue empty publicly accessible

This commit is contained in:
Fabian Posch 2024-01-09 21:29:22 -05:00
parent a5a989b359
commit 3713c50c47

View file

@ -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<std::unique_ptr<Task>> fresh_queue;