mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-12-01 01:29:02 +08:00
fix_deadlock_general_service: fix deadlock when join general service.
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
parent
7c2cf6c9b3
commit
7c99ac2ba2
@ -89,7 +89,12 @@ impl<T: Subscriber + From<ConnInner>> Service for ServiceTmpl<T> {
|
||||
|
||||
fn join(&self) {
|
||||
self.0.write().unwrap().active = false;
|
||||
self.0.write().unwrap().handle.take().map(JoinHandle::join);
|
||||
let handle = self.0.write().unwrap().handle.take();
|
||||
if let Some(handle) = handle {
|
||||
if let Err(e) = handle.join() {
|
||||
log::error!("Failed to join thread for service {}, {:?}", self.name(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user