mirror of
https://git.ethanthesleepy.one/ethanaobrien/ew
synced 2026-01-12 08:12:36 +08:00
Divide lib a little more
This commit is contained in:
17
src/runtime.rs
Normal file
17
src/runtime.rs
Normal file
@@ -0,0 +1,17 @@
|
||||
use crate::lock_onto_mutex;
|
||||
use lazy_static::lazy_static;
|
||||
use std::sync::Mutex;
|
||||
|
||||
lazy_static! {
|
||||
static ref RUNNING: Mutex<bool> = Mutex::new(false);
|
||||
}
|
||||
|
||||
pub fn set_running(running: bool) {
|
||||
let mut result = lock_onto_mutex!(RUNNING);
|
||||
*result = running;
|
||||
}
|
||||
|
||||
pub fn get_running() -> bool {
|
||||
let result = lock_onto_mutex!(RUNNING);
|
||||
*result
|
||||
}
|
||||
Reference in New Issue
Block a user