From ca74d069b98cc4dcf45aa8dc6be8cabe89a607d3 Mon Sep 17 00:00:00 2001 From: Leonardo de Moura Date: Thu, 21 Nov 2013 15:31:09 -0800 Subject: [PATCH] feat(util/interrupt): reset interrupt flag before throwing exception Signed-off-by: Leonardo de Moura --- src/util/interrupt.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/util/interrupt.cpp b/src/util/interrupt.cpp index ff40ab125..d77ea6b11 100644 --- a/src/util/interrupt.cpp +++ b/src/util/interrupt.cpp @@ -23,8 +23,10 @@ bool interrupt_requested() { } void check_interrupted() { - if (interrupt_requested()) + if (interrupt_requested()) { + reset_interrupt(); throw interrupted(); + } } std::atomic_bool * interruptible_thread::get_flag_addr() {