Remove redundant mutex

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou 2023-11-17 23:38:27 +08:00
parent e09a050d41
commit f2f649319d
2 changed files with 2 additions and 4 deletions

View File

@ -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 {
@ -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) {

View File

@ -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);
}
}