Commit ae24fb89 authored by Simon Spannagel's avatar Simon Spannagel
Browse files

ThreadPool: add lock for condition variable run_condition_

(cherry picked from commit a5b5fdbf)
parent ce7a84dc
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -127,6 +127,7 @@ void ThreadPool::worker(size_t min_thread_buffer,
        }
    } catch(...) {
        // Check if the first exception thrown
        std::unique_lock<std::mutex> lock{run_mutex_};
        if(!has_exception_.test_and_set()) {
            // Save the first exception
            exception_ptr_ = std::current_exception();