Fixed UB in spawn_at

This commit is contained in:
Emil Fresk 2021-04-08 09:12:08 +02:00
parent 2068eae928
commit 51500a1d70
4 changed files with 11 additions and 17 deletions

View file

@ -42,7 +42,7 @@ where
nr: NotReady<Mono, Task>,
enable_interrupt: F1,
pend_handler: F2,
mono: &mut Mono,
mono: Option<&mut Mono>,
) where
F1: FnOnce(),
F2: FnOnce(),
@ -57,7 +57,9 @@ where
if if_heap_max_greater_than_nr {
if Mono::DISABLE_INTERRUPT_ON_EMPTY_QUEUE && self.0.is_empty() {
mono.enable_timer();
if let Some(mono) = mono {
mono.enable_timer();
}
enable_interrupt();
}