feat(util/interrupt): reset interrupt flag before throwing exception
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
8515821d56
commit
ca74d069b9
1 changed files with 3 additions and 1 deletions
|
@ -23,9 +23,11 @@ bool interrupt_requested() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void check_interrupted() {
|
void check_interrupted() {
|
||||||
if (interrupt_requested())
|
if (interrupt_requested()) {
|
||||||
|
reset_interrupt();
|
||||||
throw interrupted();
|
throw interrupted();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
std::atomic_bool * interruptible_thread::get_flag_addr() {
|
std::atomic_bool * interruptible_thread::get_flag_addr() {
|
||||||
return &g_interrupt;
|
return &g_interrupt;
|
||||||
|
|
Loading…
Reference in a new issue