executor: fix unsoundness in InterruptExecutor::start.
The initial closure is not actually called in the interrupt, so this is illegally sending non-Send futures to the interrupt. Remove the closure, and return a SendSpawner instead.
This commit is contained in:
@ -124,17 +124,15 @@ fn main() -> ! {
|
||||
let irq = interrupt::take!(UART4);
|
||||
irq.set_priority(interrupt::Priority::P6);
|
||||
let executor = EXECUTOR_HIGH.put(InterruptExecutor::new(irq));
|
||||
executor.start(|spawner| {
|
||||
unwrap!(spawner.spawn(run_high()));
|
||||
});
|
||||
let spawner = executor.start();
|
||||
unwrap!(spawner.spawn(run_high()));
|
||||
|
||||
// Medium-priority executor: SWI0_EGU0, priority level 7
|
||||
let irq = interrupt::take!(UART5);
|
||||
irq.set_priority(interrupt::Priority::P7);
|
||||
let executor = EXECUTOR_MED.put(InterruptExecutor::new(irq));
|
||||
executor.start(|spawner| {
|
||||
unwrap!(spawner.spawn(run_med()));
|
||||
});
|
||||
let spawner = executor.start();
|
||||
unwrap!(spawner.spawn(run_med()));
|
||||
|
||||
// Low priority executor: runs in thread mode, using WFE/SEV
|
||||
let executor = EXECUTOR_LOW.put(Executor::new());
|
||||
|
Reference in New Issue
Block a user