aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEmil Fresk <emil.fresk@gmail.com>2021-04-08 09:12:08 +0200
committerEmil Fresk <emil.fresk@gmail.com>2021-04-08 10:14:14 +0200
commit51500a1d7096395be9162599fae647ec121db91d (patch)
tree17f732cbb06dd480bd0881d0ec627cc173ba5bfc /src
parent2068eae9280881e34b5cc2d76b0b1a61402223e7 (diff)
Fixed UB in `spawn_at`
Diffstat (limited to 'src')
-rw-r--r--src/tq.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/tq.rs b/src/tq.rs
index 3864025..985e0f8 100644
--- a/src/tq.rs
+++ b/src/tq.rs
@@ -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();
}