tangram_kill_chip 0.5.0

Tangram is an automated machine learning framework designed for programmers.
Documentation
use std::sync::atomic::{AtomicBool, Ordering};

pub struct KillChip(AtomicBool);

impl KillChip {
	pub const fn new() -> Self {
		KillChip(AtomicBool::new(false))
	}

	pub fn default() -> Self {
		KillChip(AtomicBool::new(false))
	}

	pub fn activate(&self) -> bool {
		self.0.swap(true, Ordering::SeqCst)
	}

	pub fn is_activated(&self) -> bool {
		self.0.load(Ordering::SeqCst)
	}
}