From b169ee8149ce711067d68f1b9539caf4b1922aa6 Mon Sep 17 00:00:00 2001 From: Tunglies Date: Sat, 16 Aug 2025 04:24:03 +0000 Subject: [PATCH] Revert "refactor: replace tokio Mutex with parking_lot Mutex for improved performance" This reverts commit 9cc6dde9991f50c745e6dbda6e06a4b9a7a65709. --- src-tauri/src/core/core.rs | 2 +- src-tauri/src/ipc/memory.rs | 3 +-- src-tauri/src/ipc/traffic.rs | 3 +-- src-tauri/src/lib.rs | 4 +++- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src-tauri/src/core/core.rs b/src-tauri/src/core/core.rs index 5469d968d..02f4ed269 100644 --- a/src-tauri/src/core/core.rs +++ b/src-tauri/src/core/core.rs @@ -14,7 +14,6 @@ use crate::{ }; use anyhow::Result; use chrono::Local; -use parking_lot::Mutex; use std::{ fmt, fs::{create_dir_all, File}, @@ -23,6 +22,7 @@ use std::{ sync::Arc, }; use tauri_plugin_shell::{process::CommandChild, ShellExt}; +use tokio::sync::Mutex; #[derive(Debug)] pub struct CoreManager { diff --git a/src-tauri/src/ipc/memory.rs b/src-tauri/src/ipc/memory.rs index 6869754e5..7fc7b2d8c 100644 --- a/src-tauri/src/ipc/memory.rs +++ b/src-tauri/src/ipc/memory.rs @@ -1,7 +1,6 @@ -use parking_lot::RwLock; use serde::{Deserialize, Serialize}; use std::{sync::Arc, time::Instant}; -use tokio::time::Duration; +use tokio::{sync::RwLock, time::Duration}; use crate::{ ipc::monitor::{IpcStreamMonitor, MonitorData, StreamingParser}, diff --git a/src-tauri/src/ipc/traffic.rs b/src-tauri/src/ipc/traffic.rs index 11ed1e0e7..a7a329a1b 100644 --- a/src-tauri/src/ipc/traffic.rs +++ b/src-tauri/src/ipc/traffic.rs @@ -1,7 +1,6 @@ -use parking_lot::RwLock; use serde::{Deserialize, Serialize}; use std::{sync::Arc, time::Instant}; -use tokio::time::Duration; +use tokio::{sync::RwLock, time::Duration}; use crate::{ ipc::monitor::{IpcStreamMonitor, MonitorData, StreamingParser}, diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index df8210f6e..37c3628b7 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -181,7 +181,9 @@ mod app_init { builder = builder.plugin(tauri_plugin_devtools::init()); } - builder.manage(Mutex::new(state::lightweight::LightWeightState::default())) + builder.manage(std::sync::Mutex::new( + state::lightweight::LightWeightState::default(), + )) } /// Setup deep link handling