metal: prevent infinite loop in hardware-cursor update
This commit is contained in:
parent
a252812848
commit
8227d3ccad
2 changed files with 12 additions and 0 deletions
|
|
@ -24,6 +24,10 @@ pub async fn handle_hardware_cursor_tick(state: Rc<State>) {
|
||||||
log::error!("Could not wait for cursor tick: {}", ErrorFmt(e));
|
log::error!("Could not wait for cursor tick: {}", ErrorFmt(e));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if state.hardware_tick_cursor.is_not_empty() {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
state.refresh_hardware_cursors();
|
state.refresh_hardware_cursors();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,14 @@ impl<T> AsyncQueue<T> {
|
||||||
AsyncQueueNonEmpty { queue: self }
|
AsyncQueueNonEmpty { queue: self }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn is_empty(&self) -> bool {
|
||||||
|
unsafe { self.data.get().deref().is_empty() }
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn is_not_empty(&self) -> bool {
|
||||||
|
!self.is_empty()
|
||||||
|
}
|
||||||
|
|
||||||
pub fn clear(&self) {
|
pub fn clear(&self) {
|
||||||
unsafe {
|
unsafe {
|
||||||
mem::take(self.data.get().deref_mut());
|
mem::take(self.data.get().deref_mut());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue