aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/signals.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/signals.cc')
-rw-r--r--src/libutil/signals.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libutil/signals.cc b/src/libutil/signals.cc
index 04a697d01..dac2964ae 100644
--- a/src/libutil/signals.cc
+++ b/src/libutil/signals.cc
@@ -12,13 +12,18 @@ std::atomic<bool> _isInterrupted = false;
thread_local std::function<bool()> interruptCheck;
+Interrupted makeInterrupted()
+{
+ return Interrupted("interrupted by the user");
+}
+
void _interrupted()
{
/* Block user interrupts while an exception is being handled.
Throwing an exception while another exception is being handled
kills the program! */
if (!std::uncaught_exceptions()) {
- throw Interrupted("interrupted by the user");
+ throw makeInterrupted();
}
}
@@ -78,7 +83,7 @@ void triggerInterrupt()
try {
callback();
} catch (...) {
- ignoreException();
+ ignoreExceptionInDestructor();
}
}
}