We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 89dc3a5 commit 10dfe6bCopy full SHA for 10dfe6b
source/adapters/native_cpu/threadpool.hpp
@@ -81,8 +81,11 @@ class worker_thread {
81
82
// Waits for all tasks to finish and destroys the worker thread
83
inline void stop() {
84
- m_isRunning.store(false, std::memory_order_release);
85
- m_startWorkCondition.notify_all();
+ {
+ std::lock_guard<std::mutex> lock(m_workMutex);
86
+ m_isRunning.store(false, std::memory_order_release);
87
+ m_startWorkCondition.notify_all();
88
+ }
89
if (m_worker.joinable()) {
90
// Wait for the worker thread to finish handling the task queue
91
m_worker.join();
0 commit comments