Skip to content

Commit

Permalink
Remove redundant mutex
Browse files Browse the repository at this point in the history
Signed-off-by: fufesou <[email protected]>
  • Loading branch information
fufesou committed Nov 17, 2023
1 parent e09a050 commit f2f6493
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ lazy_static::lazy_static! {
// Now we use this [`CLIENT_SERVER`] to do following operations:
// - record local audio, and send to remote
pub static ref CLIENT_SERVER: ServerPtr = new();
static ref PRIMARY_VIDEO_SERVICE_LOCK: Arc<Mutex<()>> = Default::default();
}

pub struct Server {
Expand Down Expand Up @@ -260,8 +259,7 @@ impl Server {
name.starts_with(video_service::NAME)
}

pub fn try_add_privay_video_service(&mut self) {
let _lock = PRIMARY_VIDEO_SERVICE_LOCK.lock().unwrap();
pub fn try_add_primay_video_service(&mut self) {
let primary_video_service_name =
video_service::get_service_name(*display_service::PRIMARY_DISPLAY_IDX);
if !self.contains(&primary_video_service_name) {
Expand Down
2 changes: 1 addition & 1 deletion src/server/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1244,7 +1244,7 @@ impl Connection {
#[cfg(not(any(target_os = "android", target_os = "ios")))]
let _h = try_start_record_cursor_pos();
self.auto_disconnect_timer = Self::get_auto_disconenct_timer();
s.try_add_privay_video_service();
s.try_add_primay_video_service();
s.add_connection(self.inner.clone(), &noperms);
}
}
Expand Down

0 comments on commit f2f6493

Please sign in to comment.