Skip to content

Commit

Permalink
fix(scheduler): move cursor creation to first use
Browse files Browse the repository at this point in the history
Co-authored-by: Edmund Grimley Evans <[email protected]>
Signed-off-by: Martin Kröning <[email protected]>
  • Loading branch information
mkroening and egrimley-arm committed Sep 11, 2023
1 parent a2656ce commit 16bfb55
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 16bfb55

Please sign in to comment.