mirror of
https://github.com/NixOS/nix
synced 2025-06-25 14:51:16 +02:00
Merge pull request #12307 from NixOS/mergify/bp/2.24-maintenance/pr-12294
processGraph(): Don't throw ThreadPoolShutDown if there is an exception (backport #12294)
This commit is contained in:
commit
296769742b
1 changed files with 10 additions and 2 deletions
|
@ -150,8 +150,16 @@ void processGraph(
|
|||
}
|
||||
};
|
||||
|
||||
for (auto & node : nodes)
|
||||
pool.enqueue(std::bind(worker, std::ref(node)));
|
||||
for (auto & node : nodes) {
|
||||
try {
|
||||
pool.enqueue(std::bind(worker, std::ref(node)));
|
||||
} catch (ThreadPoolShutDown &) {
|
||||
/* Stop if the thread pool is shutting down. It means a
|
||||
previous work item threw an exception, so process()
|
||||
below will rethrow it. */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pool.process();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue