/
Locking the Scheduler
Locking the Scheduler
It is possible for a task to lock the scheduler and thus prevent preemption. In other words, locking the scheduler makes the current task the highest priority task. This is accomplished by calling OSSchedLock(). To unlock the scheduler, you simply call OSSchedUnlock().
Interrupts are still recognized when the scheduler is locked but the kernel will not switch to a higher priority task while the scheduler is locked. It's generally not recommended to lock the scheduler in your application because it defeats the purpose of having the kernel manage your tasks.
Related content
Lock-Unlock
Lock-Unlock
More like this
OSSchedUnlock
OSSchedUnlock
More like this
OSSchedLock
OSSchedLock
More like this
Scheduling Internals
Scheduling Internals
More like this
Preemptive Scheduling
Preemptive Scheduling
More like this
OSTaskSemPost
OSTaskSemPost
More like this