1
1
mirror of https://github.com/wez/wezterm.git synced 2024-09-19 18:57:59 +03:00

mux: avoid deadlock in mux server

Ensure that we don't need a lock to examine the tab_id
This commit is contained in:
Wez Furlong 2022-12-19 22:06:59 -07:00
parent fe55ace7d9
commit 19b01261cb
No known key found for this signature in database
GPG Key ID: 7A7F66A31EC9B387

View File

@ -50,6 +50,7 @@ struct TabInner {
/// A Tab is a container of Panes
pub struct Tab {
inner: Mutex<TabInner>,
tab_id: TabId,
}
#[derive(Clone)]
@ -505,8 +506,11 @@ fn cell_dimensions(size: &TerminalSize) -> TerminalSize {
impl Tab {
pub fn new(size: &TerminalSize) -> Self {
let inner = TabInner::new(size);
let tab_id = inner.id;
Self {
inner: Mutex::new(TabInner::new(size)),
inner: Mutex::new(inner),
tab_id,
}
}
@ -580,7 +584,7 @@ impl Tab {
}
pub fn tab_id(&self) -> TabId {
self.inner.lock().tab_id()
self.tab_id
}
pub fn get_size(&self) -> TerminalSize {
@ -1099,10 +1103,6 @@ impl TabInner {
dividers
}
fn tab_id(&self) -> TabId {
self.id
}
fn get_size(&self) -> TerminalSize {
self.size
}