task_lock. STMicroelectronics OS20
โฆษณา
โฆษณา
16.2 OS20 function descriptions 16 Alphabetical list of functions
task_lock
Prevent task rescheduling
Synopsis
#include <task.h> void task_lock( void );
Arguments
None
Results
None
Errors
None
Description
This function prevents the kernel scheduler from preempting or timeslicing the current task, although the task can still be interrupted by interrupt handlers (and high-priority processes on the ST20-C2).
This function should always be called as a pair with task_unlock() , so that it can be used to create a critical region in which the task cannot be preempted by another task. If the task deschedules, the lock is terminated. Calls to task_lock() can be nested, and the lock not be released until an equal number of calls to task_unlock() have been made.
Callable from
Tasks only
See also
265
ADCS 7473749D
ดาวน์โหลด
โฆษณา