Commit 09057f91 authored by Simon Spannagel's avatar Simon Spannagel
Browse files

ThreadPool: unlock run_condition_ also when done_ == true (destroying pool)

(cherry picked from commit cc3096fe)
parent a76404a1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ void ThreadPool::checkException() {

void ThreadPool::wait() {
    std::unique_lock<std::mutex> lock{run_mutex_};
    run_condition_.wait(lock, [this]() { return exception_ptr_ != nullptr || (run_cnt_ == 0); });
    run_condition_.wait(lock, [this]() { return exception_ptr_ != nullptr || (run_cnt_ == 0 || done_ == true); });
}

/**