micro-os-plus/micro-os-plus-iii

Do not switch threads while the scheduler is locked

Closed this issue · 2 comments

In certain conditions, locking the scheduler is not immediate, there still may be one or more context switches.

Locking the scheduler needs to immediately block the thread switching logic, and not rely on the port implementation of reschedule(), since on platforms like Cortex-M not generating the PendSV interrupt is not enough, the ready list may be long and the threads in the list still get scheduled.

Fixed in v6.3.15.