TSK_disable
2-490
C Interface
Syntax
TSK_disable();
Parameters
Void
Return Value
Void
Description
TSK_disable disables the DSP/BIOS task scheduler. The current task
continues to execute (even if a higher priority task can become ready to
run) until TSK_enable is called.
TSK_disable does not disable interrupts, but is instead used before
disabling interrupts to make sure a context switch to another task does
not occur when interrupts are disabled.
TSK_disable maintains a count which allows nested calls to
TSK_disable. Task switching is not reenabled until TSK_enable has
been called as many times as TSK_disable. Calls to TSK_disable can be
nested.
Since TSK_disable can prohibit ready tasks of higher priority from
running it should not be used as a general means of mutual exclusion.
SEM Module semaphores should be used for mutual exclusion when
possible.
Constraints and
Calling Context
❏
Do not call any function that can cause the current task to block within
a TSK_disable/TSK_enable block. For example, SEM_pend (if
timeout is non-zero), TSK_sleep, TSK_yield, and MEM_alloc can all
cause blocking. For a complete list, see Section A.1,
❏
TSK_disable cannot be called from a SWI or HWI.
❏
TSK_disable cannot be called from the program’s main() function.
❏
Do not call TSK_enable when TSKs are already enabled. If you do
so, the subsequent call to TSK_disable will not disable TSK
processing.
See Also
TSK_disable
Disable DSP/BIOS task scheduler