mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 06:17:49 +00:00
Update crossbeam
Updated crossbeam to 0.3.11 and fixed breaking changes.
This commit is contained in:
@@ -1055,7 +1055,7 @@ To use the type, we need to add a dependency on the `crossbeam-queue` crate:
|
||||
# in Cargo.toml
|
||||
|
||||
[dependencies.crossbeam-queue]
|
||||
version = "0.2.1"
|
||||
version = "0.3.11"
|
||||
default-features = false
|
||||
features = ["alloc"]
|
||||
```
|
||||
@@ -1233,8 +1233,8 @@ impl Stream for ScancodeStream {
|
||||
fn poll_next(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Option<u8>> {
|
||||
let queue = SCANCODE_QUEUE.try_get().expect("not initialized");
|
||||
match queue.pop() {
|
||||
Ok(scancode) => Poll::Ready(Some(scancode)),
|
||||
Err(crossbeam_queue::PopError) => Poll::Pending,
|
||||
Some(scancode) => Poll::Ready(Some(scancode)),
|
||||
None => Poll::Pending,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1284,17 +1284,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,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1546,7 +1546,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
|
||||
|
||||
Reference in New Issue
Block a user