Skip to content

Commit

Permalink
Merge pull request #908 from mkroening/cursor-use
Browse files Browse the repository at this point in the history
fix(scheduler): move cursor creation to first use
  • Loading branch information
mkroening authored Sep 11, 2023
2 parents a2656ce + 16bfb55 commit 2c9fdef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/scheduler/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,6 @@ impl BlockedTaskQueue {
pub fn handle_waiting_tasks(&mut self) {
// Get the current time.
let time = arch::processor::get_timer_ticks();
let mut cursor = self.list.cursor_front_mut();

#[cfg(any(feature = "tcp", feature = "udp"))]
if let Some(mut guard) = crate::executor::network::NIC.try_lock() {
Expand All @@ -650,6 +649,7 @@ impl BlockedTaskQueue {
}

// Loop through all blocked tasks.
let mut cursor = self.list.cursor_front_mut();
while let Some(node) = cursor.current() {
// Get the wakeup time of this task and check if we have reached the first task
// that hasn't elapsed yet or waits indefinitely.
Expand Down

0 comments on commit 2c9fdef

Please sign in to comment.