add function to stop threads and make queue empty publicly accessible
This commit is contained in:
parent
a5a989b359
commit
3713c50c47
1 changed files with 3 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue