mirror of
https://github.com/NixOS/nix.git
synced 2024-11-22 14:52:55 +00:00
ThreadPool: catch Interrupted
This commit is contained in:
parent
de41e46175
commit
3f9ff10786
@ -110,6 +110,11 @@ void ThreadPool::doWork(bool mainThread)
|
|||||||
propagate it. */
|
propagate it. */
|
||||||
try {
|
try {
|
||||||
std::rethrow_exception(exc);
|
std::rethrow_exception(exc);
|
||||||
|
} catch (const Interrupted &) {
|
||||||
|
// The interrupted state may be picked up multiple
|
||||||
|
// workers, which is expected, so we should ignore
|
||||||
|
// it silently and let the first one bubble up,
|
||||||
|
// rethrown via the original state->exception.
|
||||||
} catch (std::exception & e) {
|
} catch (std::exception & e) {
|
||||||
if (!dynamic_cast<ThreadPoolShutDown*>(&e))
|
if (!dynamic_cast<ThreadPoolShutDown*>(&e))
|
||||||
ignoreExceptionExceptInterrupt();
|
ignoreExceptionExceptInterrupt();
|
||||||
|
Loading…
Reference in New Issue
Block a user