diff options
Diffstat (limited to 'src/libutil/thread-pool.hh')
-rw-r--r-- | src/libutil/thread-pool.hh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libutil/thread-pool.hh b/src/libutil/thread-pool.hh index 835dfb4b8..06a097ab5 100644 --- a/src/libutil/thread-pool.hh +++ b/src/libutil/thread-pool.hh @@ -7,6 +7,7 @@ #include <functional> #include <thread> #include <map> +#include <atomic> namespace nix { @@ -47,9 +48,10 @@ private: size_t active = 0; std::exception_ptr exception; std::vector<std::thread> workers; - bool quit = false; }; + std::atomic_bool quit{false}; + Sync<State> state_; std::condition_variable work, done; |