From 3fd3f85cc9283710b36e8368549f52cca606c42e Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Wed, 22 Jan 2025 13:07:10 -0600 Subject: [PATCH] refactor --- repertory/librepertory/src/utils/polling.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/repertory/librepertory/src/utils/polling.cpp b/repertory/librepertory/src/utils/polling.cpp index 679fc510..57c0899a 100644 --- a/repertory/librepertory/src/utils/polling.cpp +++ b/repertory/librepertory/src/utils/polling.cpp @@ -147,10 +147,14 @@ void polling::stop() { tasks::instance().stop(); unique_mutex_lock thread_lock(mutex_); + std::array, + static_cast(frequency::size)> + threads; + std::swap(threads, frequency_threads_); notify_.notify_all(); thread_lock.unlock(); - for (auto &thread : frequency_threads_) { + for (auto &thread : threads) { thread->join(); thread.reset(); }