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
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue