Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Commit

Permalink
Fix data race
Browse files Browse the repository at this point in the history
  • Loading branch information
MBkkt authored Jan 23, 2024
1 parent 28629c0 commit e1d6016
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/utils/async_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,12 @@ void ThreadPool<UseDelay>::stop(bool skip_pending) noexcept {
return;
}
state_ |= 1;
auto threads = std::move(threads_);
lock.unlock();
cv_.notify_all();
for (auto& t : threads_) {
for (auto& t : threads) {
t.join();
}
threads_ = decltype(threads_){};
}

template<bool UseDelay>
Expand Down

0 comments on commit e1d6016

Please sign in to comment.