opendefocus 0.1.10

An advanced open-source convolution library for image post-processing
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::sync::{
    Arc, LazyLock,
    atomic::{AtomicBool, Ordering},
};

static ABORTED: LazyLock<Arc<AtomicBool>> = LazyLock::new(|| Arc::new(AtomicBool::new(false)));

/// Gets the current abort status.
///
/// This can be read across threads to allow for early exits if application has abort status set
pub fn get_aborted() -> bool {
    ABORTED.load(Ordering::SeqCst)
}

/// Sets the abort status.
pub fn set_aborted(status: bool) {
    ABORTED.store(status, Ordering::SeqCst);
}