about summary refs log tree commit diff
path: root/src/libutil/thread-pool.hh
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-09-08T12·40+0200
committerEelco Dolstra <edolstra@gmail.com>2017-09-08T12·42+0200
commit8f6b347abd93706e36cf67fc4c53a46c7ad1ad49 (patch)
treee633fe5a3e5526c50c539480f108564efe22fbb5 /src/libutil/thread-pool.hh
parenta2740c9ca23e748c3ab8ea61a135594a94c86aae (diff)
ThreadPool: Improve exception handling
In particular, process() won't return as long as there are active
items. This prevents work item lambdas from referring to stack frames
that no longer exist.
Diffstat (limited to 'src/libutil/thread-pool.hh')
-rw-r--r--src/libutil/thread-pool.hh2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libutil/thread-pool.hh b/src/libutil/thread-pool.hh
index 361a9d33a732..835dfb4b83a6 100644
--- a/src/libutil/thread-pool.hh
+++ b/src/libutil/thread-pool.hh
@@ -44,7 +44,7 @@ private:
     struct State
     {
         std::queue<work_t> left;
-        size_t pending = 0;
+        size_t active = 0;
         std::exception_ptr exception;
         std::vector<std::thread> workers;
         bool quit = false;