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 fresh_buffer_full();
|
||||||
|
|
||||||
bool running() { return !this->stop_flag.load(std::memory_order_relaxed); };
|
bool running() { return !this->stop_flag.load(std::memory_order_relaxed); };
|
||||||
|
void stop() { this->stop_flag.store(false, std::memory_order_relaxed); };
|
||||||
private:
|
|
||||||
|
|
||||||
bool fresh_queue_empty();
|
bool fresh_queue_empty();
|
||||||
bool finished_queue_empty();
|
bool finished_queue_empty();
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
size_t buffer_size;
|
size_t buffer_size;
|
||||||
|
|
||||||
std::queue<std::unique_ptr<Task>> fresh_queue;
|
std::queue<std::unique_ptr<Task>> fresh_queue;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue