Skip to content

Commit

Permalink
Update to crossbeam-queue v0.3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-opp committed May 30, 2024
1 parent a2ca911 commit df2c149
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 27 deletions.
26 changes: 4 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ version = "1.0"
features = ["spin_no_std"]

[dependencies.crossbeam-queue]
version = "0.2.1"
version = "0.3.11"
default-features = false
features = ["alloc"]

Expand Down
2 changes: 1 addition & 1 deletion src/task/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl Executor {
waker_cache,
} = self;

while let Ok(task_id) = task_queue.pop() {
while let Some(task_id) = task_queue.pop() {
let task = match tasks.get_mut(&task_id) {
Some(task) => task,
None => continue, // task no longer exists
Expand Down
6 changes: 3 additions & 3 deletions src/task/keyboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@ impl Stream for ScancodeStream {
.expect("scancode queue not initialized");

// fast path
if let Ok(scancode) = queue.pop() {
if let Some(scancode) = queue.pop() {
return Poll::Ready(Some(scancode));
}

WAKER.register(&cx.waker());
match queue.pop() {
Ok(scancode) => {
Some(scancode) => {
WAKER.take();
Poll::Ready(Some(scancode))
}
Err(crossbeam_queue::PopError) => Poll::Pending,
None => Poll::Pending,
}
}
}
Expand Down

0 comments on commit df2c149

Please sign in to comment.