Ran cargo fmt, clippy fixes, suppressed some warns
I will start working on stack traces tonight and tomorrow. We need to be able to 'unwind' by finding calling functions.
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
//!
|
||||
//! Written by @zxq5 for the most part with code from
|
||||
//! [here](https://github.com/phil-opp/blog_os/).
|
||||
//!
|
||||
|
||||
use alloc::boxed::Box;
|
||||
use alloc::collections::BTreeMap;
|
||||
@@ -81,9 +80,9 @@ impl Executor {
|
||||
Some(task) => task,
|
||||
None => continue, // task no longer exists
|
||||
};
|
||||
let waker = waker_cache
|
||||
.entry(task_id)
|
||||
.or_insert_with(|| TaskWaker::new_waker(task_id, task_queue.clone()));
|
||||
let waker = waker_cache.entry(task_id).or_insert_with(|| {
|
||||
TaskWaker::new_waker(task_id, task_queue.clone())
|
||||
});
|
||||
let mut context = Context::from_waker(waker);
|
||||
match task.poll(&mut context) {
|
||||
Poll::Ready(()) => {
|
||||
@@ -129,7 +128,10 @@ impl TaskWaker {
|
||||
self.task_queue.push(self.task_id).expect("task_queue full");
|
||||
}
|
||||
|
||||
fn new_waker(task_id: TaskId, task_queue: Arc<ArrayQueue<TaskId>>) -> Waker {
|
||||
fn new_waker(
|
||||
task_id: TaskId,
|
||||
task_queue: Arc<ArrayQueue<TaskId>>,
|
||||
) -> Waker {
|
||||
Waker::from(Arc::new(Self {
|
||||
task_id,
|
||||
task_queue,
|
||||
|
||||
Reference in New Issue
Block a user