use lazy_static::lazy_static;
use std::sync::atomic::{AtomicBool, Ordering};
lazy_static! {
static ref INTERRUPTED: AtomicBool = AtomicBool::new(false);
}
pub fn interrupted() -> bool {
INTERRUPTED.load(Ordering::SeqCst)
}
pub fn unset_interrupted() {
debug_assert!(INTERRUPTED.load(Ordering::SeqCst));
INTERRUPTED.store(false, Ordering::SeqCst)
}
pub fn set_interrupted() {
INTERRUPTED.store(true, Ordering::SeqCst)
}