about summary refs log tree commit diff
path: root/src/libutil/thread-pool.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/thread-pool.hh')
-rw-r--r--src/libutil/thread-pool.hh4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libutil/thread-pool.hh b/src/libutil/thread-pool.hh
index 835dfb4b83..06a097ab5e 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;