1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-29 06:21:14 +02:00

Improve SIGINT handling in multi-threaded programs

The flag remembering whether an Interrupted exception was thrown is
now thread-local. Thus, all threads will (eventually) throw
Interrupted. Previously, one thread would throw Interrupted, and then
the other threads wouldn't see that they were supposed to quit.
This commit is contained in:
Eelco Dolstra 2016-03-29 15:08:24 +02:00
parent 4f34c40398
commit ab3ce1cc13
4 changed files with 12 additions and 14 deletions

View file

@ -316,6 +316,8 @@ void restoreSIGPIPE();
extern volatile sig_atomic_t _isInterrupted;
extern thread_local bool interruptThrown;
void _interrupted();
void inline checkInterrupt()