mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 17:15:38 +08:00
fix: manage setup Mutex crash (#3995)
* Revert "Revert "refactor: Replace std::sync::Mutex with parking_lot::Mutex for improved performance and consistency in multiple files" (#3990)"
This reverts commit 667844aa12.
* refactor: Manage lightweight state in the app setup and clean up unused proxy client code
* refactor: Move macOS-specific Manager import under conditional compilation
This commit is contained in:
@@ -13,10 +13,8 @@ use crate::AppHandleManager;
|
||||
|
||||
use anyhow::{Context, Result};
|
||||
use delay_timer::prelude::TaskBuilder;
|
||||
use std::sync::{
|
||||
atomic::{AtomicBool, Ordering},
|
||||
Mutex,
|
||||
};
|
||||
use parking_lot::Mutex;
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
use tauri::{Listener, Manager};
|
||||
|
||||
const LIGHT_WEIGHT_TASK_UID: &str = "light_weight_task";
|
||||
@@ -30,7 +28,7 @@ where
|
||||
{
|
||||
let app_handle = handle::Handle::global().app_handle().unwrap();
|
||||
let state = app_handle.state::<Mutex<LightWeightState>>();
|
||||
let mut guard = state.lock().unwrap();
|
||||
let mut guard = state.lock();
|
||||
f(&mut guard)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user