Download OS21 USER MANUAL - STMicroelectronics

Transcript
Interrupts
OS21
interrupt_lock
Disable all interrupts
Definition:
#include <os21.h>
void interrupt_lock(void);
Arguments:
None
Returns:
None
Errors:
None
Context:
Callable from task or system context.
Description:
This function disables all interrupts to the CPU.
Note: This call is deprecated, and will be removed from future releases of OS21. Use
interrupt_mask_all() instead.
This function must always be called as a pair with interrupt_unlock(), so that it
can be used to create a critical region in which the task cannot be preempted by any
other task or interrupt. Calls to interrupt_lock() can be nested, and the lock is
not released until an equal number of calls to interrupt_unlock() are made.
A task must not deschedule while an interrupt lock is in effect. When interrupts are
locked, calling any function that may not be called by an interrupt service routine is
illegal.
See also:
156/226
interrupt_unlock, interrupt_mask, interrupt_mask_all, task_lock
7358306