Skip to content

Commit

Permalink
allow always interrupts during block_on
Browse files Browse the repository at this point in the history
  • Loading branch information
stlankes committed Aug 7, 2023
1 parent 0ee1531 commit 3ebaf3e
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/executor/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,6 @@ where
}
}

// disable all interrupts
interrupts::disable();
let delay = network_delay(now).map(|d| d.total_micros());
if backoff.is_completed() && delay.unwrap_or(10_000_000) > 10_000 {
let ticks = crate::arch::processor::get_timer_ticks();
Expand All @@ -288,19 +286,13 @@ where
// allow network interrupts
get_network_driver().unwrap().lock().set_polling_mode(false);

// enable interrupts
interrupts::enable();

// switch to another task
task_notify.wait(wakeup_time);

// restore default values
get_network_driver().unwrap().lock().set_polling_mode(true);
backoff.reset();
} else {
// enable interrupts
interrupts::enable();

backoff.snooze();
}
}
Expand Down

0 comments on commit 3ebaf3e

Please sign in to comment.