Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cortexm_common: disable IRQ during thread_sched_idle
A race condition is present where an IRQ is serviced between the priority increase of the PENDSV and the sleep. When the IRQ is serviced before the WFI sleep, the core will sleep until the next IRQ and the thread activated by the IRQ will not be scheduled until a new IRQ triggers. This commit wraps an IRQ disable and restore around the priority modification and sleep to prevent interrupts from being serviced until the WFI call returns. (cherry picked from commit eec7aa2)
- Loading branch information