Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

Commit

Permalink
Fix missed items in thread queue
Browse files Browse the repository at this point in the history
  • Loading branch information
filiptibell committed Feb 13, 2024
1 parent 7c59d0c commit 71026f9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,12 @@ impl ThreadQueue {
#[inline]
pub async fn wait_for_item(&self) {
if self.queue.is_empty() {
self.event.listen().await;
let listener = self.event.listen();
// NOTE: Need to check again, we could have gotten
// new queued items while creating our listener
if self.queue.is_empty() {
listener.await;
}
}
}

Expand Down

0 comments on commit 71026f9

Please sign in to comment.