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

Commit 71026f9

Browse files
committed
Fix missed items in thread queue
1 parent 7c59d0c commit 71026f9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/queue.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,12 @@ impl ThreadQueue {
6060
#[inline]
6161
pub async fn wait_for_item(&self) {
6262
if self.queue.is_empty() {
63-
self.event.listen().await;
63+
let listener = self.event.listen();
64+
// NOTE: Need to check again, we could have gotten
65+
// new queued items while creating our listener
66+
if self.queue.is_empty() {
67+
listener.await;
68+
}
6469
}
6570
}
6671

0 commit comments

Comments
 (0)