mirror of
https://github.com/NixOS/nix
synced 2025-06-25 10:41:16 +02:00
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.
This commit is contained in:
parent
a2740c9ca2
commit
8f6b347abd
2 changed files with 53 additions and 24 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue