Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

refactor(ensu): request only required mutex access

setalp287fe3f34d6c
diff --git a/rust/apps/ensu/src-tauri/src/single_instance/windows.rs b/rust/apps/ensu/src-tauri/src/single_instance/windows.rs
index 2ee1ced0cd..3a6181059c 100644
--- a/rust/apps/ensu/src-tauri/src/single_instance/windows.rs
+++ b/rust/apps/ensu/src-tauri/src/single_instance/windows.rs
@@ -12,8 +12,7 @@ use windows_sys::Win32::Security::Authorization::{
use windows_sys::Win32::Security::SECURITY_ATTRIBUTES;
use windows_sys::Win32::System::Threading::{
CREATE_EVENT_MANUAL_RESET, CreateEventExW, CreateMutexExW, EVENT_MODIFY_STATE, INFINITE,
- MUTEX_MODIFY_STATE, ResetEvent, SYNCHRONIZATION_SYNCHRONIZE, SetEvent, WaitForMultipleObjects,
- WaitForSingleObject,
+ ResetEvent, SYNCHRONIZATION_SYNCHRONIZE, SetEvent, WaitForMultipleObjects, WaitForSingleObject,
};
pub(super) struct Instance {
@@ -31,14 +30,7 @@ impl Instance {
pub(super) fn acquire(identifier: &str) -> io::Result<Option<Self>> {
let ownership = named_handle(
&format!("Local\\{identifier}.instance"),
- |attrs, name| unsafe {
- CreateMutexExW(
- attrs,
- name,
- 0,
- SYNCHRONIZATION_SYNCHRONIZE | MUTEX_MODIFY_STATE,
- )
- },
+ |attrs, name| unsafe { CreateMutexExW(attrs, name, 0, SYNCHRONIZATION_SYNCHRONIZE) },
)?;
let activation = named_handle(
&format!("Local\\{identifier}.activation"),