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

ThreadPool: add lock for condition variable run_condition_

parent 8248d827
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -136,6 +136,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();