plugin_framework, test plugin manager, uninstall is not fully tested

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou committed 2023-05-12 08:48:42 +08:00
1 parent 4ee0fd9676
commit 095ac46255
12 files changed
+327 -116

No files matched your search

+8 -2
View File
@@ -1,6 +1,6 @@
use std::{
future::Future,
sync::{Arc, Mutex},
sync::{Arc, Mutex, RwLock},
};
#[derive(Debug, Eq, PartialEq)]
@@ -61,6 +61,7 @@ lazy_static::lazy_static! {
lazy_static::lazy_static! {
static ref IS_SERVER: bool = std::env::args().nth(1) == Some("--server".to_owned());
static ref SERVER_RUNNING: Arc<RwLock<bool>> = Default::default();
}
#[cfg(not(any(target_os = "android", target_os = "ios")))]
@@ -93,9 +94,14 @@ pub fn global_init() -> bool {
pub fn global_clean() {}
#[inline]
pub fn set_server_running(b: bool) {
*SERVER_RUNNING.write().unwrap() = b;
}
#[inline]
pub fn is_server() -> bool {
*IS_SERVER
*IS_SERVER || *SERVER_RUNNING.read().unwrap()
}
#[inline]