diff options
author | Alois Wohlschlager <alois1@gmx-topmail.de> | 2024-05-11 12:11:43 +0200 |
---|---|---|
committer | Alois Wohlschlager <alois1@gmx-topmail.de> | 2024-05-13 09:03:53 +0200 |
commit | 914b0febf77c91ae7f20d098f62a5feefc1acdc3 (patch) | |
tree | 183307950353a76966160744afd85772583dae6a /src/libutil/signals.cc | |
parent | f6dc40cd1c3cdb38d104fb18ca76b9acf374190a (diff) |
libutil: remove the interrupt-blocking code
The interrupt-blocking code was originally introduced 20 years ago so that
trying to log an error message does not result in an interrupt exception being
thrown and then going unhandled (c8d3882cdc8f9e22c58af285c1996265c1af75d5).
However, the logging code does not check for interrupts any more
(054be5025762c5e1c7e853c4fa5d7eed8da1727f), so this reasoning is no longer
applicable. Delete this code so that later interrupts are unblocked again, for
example in the next line entered into the repl.
Closes: https://git.lix.systems/lix-project/lix/issues/296
Change-Id: I48253f5f4272e75001148c13046e709ef5427fbd
Diffstat (limited to 'src/libutil/signals.cc')
-rw-r--r-- | src/libutil/signals.cc | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/libutil/signals.cc b/src/libutil/signals.cc index f5c79b325..41fdc9dc8 100644 --- a/src/libutil/signals.cc +++ b/src/libutil/signals.cc @@ -9,21 +9,14 @@ namespace nix { std::atomic<bool> _isInterrupted = false; -static thread_local bool interruptThrown = false; thread_local std::function<bool()> interruptCheck; -void setInterruptThrown() -{ - interruptThrown = true; -} - void _interrupted() { /* Block user interrupts while an exception is being handled. Throwing an exception while another exception is being handled kills the program! */ - if (!interruptThrown && !std::uncaught_exceptions()) { - interruptThrown = true; + if (!std::uncaught_exceptions()) { throw Interrupted("interrupted by the user"); } } |