Made two variables atomic to be safe

This commit is contained in:
Jack Andersen 2019-06-15 21:12:50 -10:00
parent 7eda81e55e
commit e0674ff957
1 changed files with 2 additions and 2 deletions

View File

@ -213,11 +213,11 @@ class PipelineCompileQueue {
}; };
std::queue<Task> m_tasks; std::queue<Task> m_tasks;
size_t m_outstandingTasks = 0; std::atomic_size_t m_outstandingTasks = 0;
std::vector<std::thread> m_threads; std::vector<std::thread> m_threads;
std::mutex m_mt; std::mutex m_mt;
std::condition_variable m_cv, m_backcv; std::condition_variable m_cv, m_backcv;
bool m_running = true; std::atomic_bool m_running = true;
void worker() { void worker() {
std::unique_lock<std::mutex> lk(m_mt); std::unique_lock<std::mutex> lk(m_mt);