mirror of https://github.com/sgoudham/neovide.git
compiling but quits on startup
parent
b5ff3556fe
commit
0ef1521a18
@ -0,0 +1,34 @@
|
||||
use std::sync::{
|
||||
Arc,
|
||||
atomic::{
|
||||
AtomicBool,
|
||||
Ordering,
|
||||
},
|
||||
};
|
||||
|
||||
use log::info;
|
||||
|
||||
lazy_static! {
|
||||
pub static ref RUNNING_TRACKER: RunningTracker = RunningTracker::new();
|
||||
}
|
||||
|
||||
pub struct RunningTracker {
|
||||
running: Arc<AtomicBool>
|
||||
}
|
||||
|
||||
impl RunningTracker {
|
||||
fn new() -> Self {
|
||||
Self {
|
||||
running: Arc::new(AtomicBool::new(true))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn quit(&self, reason: &str) {
|
||||
self.running.store(false, Ordering::Relaxed);
|
||||
info!("Quit {}", reason);
|
||||
}
|
||||
|
||||
pub fn is_running(&self) -> bool {
|
||||
self.running.load(Ordering::Relaxed)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue