Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
JunkuiZhang committed Jul 28, 2024
1 parent 5226fb8 commit 5bd8bcc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions crates/gpui/src/platform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ pub(crate) use test::*;
pub(crate) use windows::*;

/// TODO:
pub fn is_single_instance() -> bool {
unsafe { CreateMutexW(None, true, &HSTRING::from("Zed-Editor-Instance")).log_err() };
pub fn check_single_instance() -> bool {
unsafe { CreateMutexW(None, true, &HSTRING::from("Local\\Zed-Editor-Instance")).log_err() };
let last_err = unsafe { GetLastError() };
last_err != ERROR_ALREADY_EXISTS
}
Expand Down
2 changes: 1 addition & 1 deletion crates/zed/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ fn main() {
// }
// }
{
if !gpui::is_single_instance() {
if !gpui::check_single_instance() {
println!("zed is already running");
return;
}
Expand Down

0 comments on commit 5bd8bcc

Please sign in to comment.