Skip to content

Commit

Permalink
anvil: fix layer surface fifo deadlock
Browse files Browse the repository at this point in the history
  • Loading branch information
cmeissl committed Dec 14, 2024
1 parent c3f3ac8 commit eb87eef
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions anvil/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,9 @@ impl<BackendData: Backend + 'static> AnvilState<BackendData> {
}
});
}
// Drop the lock to the layer map before calling blocker_cleared, which might end up
// calling the commit handler which in turn again could access the layer map.
std::mem::drop(map);

if let CursorImageStatus::Surface(ref surface) = self.cursor_status {
with_surfaces_surface_tree(surface, |surface, states| {
Expand Down Expand Up @@ -978,6 +981,9 @@ impl<BackendData: Backend + 'static> AnvilState<BackendData> {
});
}
}
// Drop the lock to the layer map before calling blocker_cleared, which might end up
// calling the commit handler which in turn again could access the layer map.
std::mem::drop(map);

if let CursorImageStatus::Surface(ref surface) = self.cursor_status {
with_surfaces_surface_tree(surface, |surface, states| {
Expand Down

0 comments on commit eb87eef

Please sign in to comment.