diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2017-09-08 14:40:27 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2017-09-08 14:42:09 +0200 |
commit | 8f6b347abd93706e36cf67fc4c53a46c7ad1ad49 (patch) | |
tree | e633fe5a3e5526c50c539480f108564efe22fbb5 /src/libutil/thread-pool.hh | |
parent | a2740c9ca23e748c3ab8ea61a135594a94c86aae (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.hh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libutil/thread-pool.hh b/src/libutil/thread-pool.hh index 361a9d33a..835dfb4b8 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; |