refactor
This commit is contained in:
@ -147,10 +147,14 @@ void polling::stop() {
|
|||||||
tasks::instance().stop();
|
tasks::instance().stop();
|
||||||
|
|
||||||
unique_mutex_lock thread_lock(mutex_);
|
unique_mutex_lock thread_lock(mutex_);
|
||||||
|
std::array<std::unique_ptr<std::thread>,
|
||||||
|
static_cast<std::size_t>(frequency::size)>
|
||||||
|
threads;
|
||||||
|
std::swap(threads, frequency_threads_);
|
||||||
notify_.notify_all();
|
notify_.notify_all();
|
||||||
thread_lock.unlock();
|
thread_lock.unlock();
|
||||||
|
|
||||||
for (auto &thread : frequency_threads_) {
|
for (auto &thread : threads) {
|
||||||
thread->join();
|
thread->join();
|
||||||
thread.reset();
|
thread.reset();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user