diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2023-07-07 10:37:36 +0100 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2023-10-03 10:52:14 +0100 |
commit | d03eaacbcfb276fb638db1b423113ff43bd7ec41 (patch) | |
tree | c4e477597f3db4e68436a5a34815ecf3506c04d0 /src/checkqueue.h | |
parent | be4ff3060b7b43b496dfb5a2c02b114b2b717106 (diff) |
Make `CCheckQueue` destructor stop worker threads
Diffstat (limited to 'src/checkqueue.h')
-rw-r--r-- | src/checkqueue.h | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/checkqueue.h b/src/checkqueue.h index a3299fb3fe..a89be2cfd5 100644 --- a/src/checkqueue.h +++ b/src/checkqueue.h @@ -179,24 +179,16 @@ public: } } - //! Stop all of the worker threads. - void StopWorkerThreads() EXCLUSIVE_LOCKS_REQUIRED(!m_mutex) + ~CCheckQueue() { WITH_LOCK(m_mutex, m_request_stop = true); m_worker_cv.notify_all(); for (std::thread& t : m_worker_threads) { t.join(); } - m_worker_threads.clear(); - WITH_LOCK(m_mutex, m_request_stop = false); } bool HasThreads() const { return !m_worker_threads.empty(); } - - ~CCheckQueue() - { - assert(m_worker_threads.empty()); - } }; /** |