PxTaskForceTemination()
Terminate a task.
- APPLIES TO
-
8.2.0
- SYNOPSIS
-
PxError_t PxTaskForceTermination (PxTask_t TaskId); - ARGUMENTS
|
- RETURN VALUES
-
-
PXROS error code
-
- ERROR CODES
-
PXERR_TASK_ILLPRIVThe calling task is not the creator
PXERR_TASK_ILLTASKThe
TaskIdis illegalPXERR_ACCESS_RIGHTThe calling task has not the right to terminate other tasks
- DESCRIPTION
-
If the caller is the creator of the task to terminate, the task will be forced to call
PxTerminatefor self destruction. If the task is waiting elsewhere it will be activated to terminate immediately.
- IMPLEMENTATION GUIDELINES
-
- Before call
-
-
The parameter
TaskIdmust be a valid task object id. This id may be-
the return value of a
PxTaskCreate()call (V) -
the result of a
nameserverquery (V) -
part of a message sent by another task (V)
-
-
Additionally the task id may be checked with
PxTaskCheck()(F).The task object must be created on the same core as the caller runs on. The creator core id can be read with the macroPxTaskCoreIdand the own core id withPxGetCoreId(C).
-
- After call
-
-
The function returns
PXERR_NOERRORif the task could be terminated. Any other return value describes an error, which has to be interpreted (C).
-
- Best Practice
-
-
No restrictions.
-
- SEE ALSO
- USAGE
-
#include "pxdef.h" PxError_t err = PxTaskForceTermination(taskId); if (err != PXERR_NOERROR) { // Report error }