mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-12 15:31:09 +00:00
Added shutdown logic.
This commit is contained in:
parent
de658b70d7
commit
002e923cf1
@ -43,6 +43,7 @@ AsyncTaskQueue::~AsyncTaskQueue()
|
||||
{
|
||||
should_destruct_ = true;
|
||||
enqueue([](){});
|
||||
thread_->join();
|
||||
}
|
||||
|
||||
void AsyncTaskQueue::enqueue(std::function<void(void)> function)
|
||||
|
@ -31,7 +31,7 @@ class AsyncTaskQueue {
|
||||
std::mutex queue_mutex_;
|
||||
std::list<std::function<void(void)>> pending_tasks_;
|
||||
std::condition_variable processing_condition_;
|
||||
bool should_destruct_;
|
||||
std::atomic_bool should_destruct_;
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user