1
0
Fork 0
forked from wry/wry

metal: prevent infinite loop in hardware-cursor update

This commit is contained in:
Julian Orth 2024-07-23 22:21:00 +02:00
parent a252812848
commit 8227d3ccad
2 changed files with 12 additions and 0 deletions

View file

@ -50,6 +50,14 @@ impl<T> AsyncQueue<T> {
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) {
unsafe {
mem::take(self.data.get().deref_mut());