CPU_BOOLEAN OSTaskSemPendAbort (OS_TCB *p_tcb,
OS_OPT opt,
OS_ERR *p_err)
File | Called from | Code enabled by |
---|---|---|
| Task only |
|
OSTaskSemPendAbort()
aborts and readies a task currently waiting on its built-in semaphore. This function should be used to fault-abort the wait on the task’s semaphore, rather than to normally signal the task via OSTaskSemPost()
.
Arguments
p_tcb
is a pointer to the task for which the pend must be aborted. Note that it does not make sense to pass a NULL
pointer or the address of the calling task’s TCB since, by definition, the calling task cannot be pending.
opt
provides options for this function.
OS_OPT_POST_NONE
no option specified, call the scheduler by default.
OS_OPT_POST_NO_SCHED
specifies that the scheduler should not be called even if the pend of a higher-priority task has been aborted. Scheduling will need to occur from another function.
Use this option if the task calling OSTaskSemPendAbort()
will be doing additional pend aborts, rescheduling will not take place until finished, and multiple pend aborts are to take effect simultaneously.
p_err
is a pointer to a variable that holds an error code:
OS_ERR_NONE
the pend was aborted for the specified task.
OS_ERR_PEND_ABORT_ISR
If OS_CFG_CALLED_FROM_ISR_CHK_EN
set to 1
in os_cfg.h
: if called from an ISR
OS_ERR_PEND_ABORT_NONE
If the task was not waiting for a signal.
OS_ERR_PEND_ABORT_SELF
If p_tcb
is a NULL
pointer or the TCB of the calling task is specified. The user is attempting to pend abort the calling task, which makes no sense since, by definition, the calling task is not pending.
Returned Value
OSTaskSemPendAbort()
returns DEF_TRUE
if the task was made ready-to-run by this function. DEF_FALSE
indicates that the task was not pending, or an error occurred.
Notes/Warnings
None