mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 01:05:54 +08:00
sched/task/task_init.c: Add nxtask_uninit()
Add trivial function nxtask_uninit(). This function will undo all operations on a TCB performed by task_init() and release the TCB by calling kmm_free(). This is intended primarily to support error recovery operations after a successful call to task_init() such was when a subsequent call to task_activate fails. That error recovery is trivial but not obvious. This helper function should eliminate confusion about what to do to recover after calling nxtask_init()
This commit is contained in:
committed by
Abdelatif Guettouche
parent
d2f10e7386
commit
b9042f5900
@@ -944,6 +944,27 @@ int nxtask_init(FAR struct tcb_s *tcb, const char *name, int priority,
|
||||
FAR uint32_t *stack, uint32_t stack_size, main_t entry,
|
||||
FAR char * const argv[]);
|
||||
|
||||
/********************************************************************************
|
||||
* Name: nxtask_uninit
|
||||
*
|
||||
* Description:
|
||||
* Undo all operations on a TCB performed by task_init() and release the
|
||||
* TCB by calling kmm_free(). This is intended primarily to support
|
||||
* error recovery operations after a successful call to task_init() such
|
||||
* was when a subsequent call to task_activate fails.
|
||||
*
|
||||
* Caution: Freeing of the TCB itself might be an unexpected side-effect.
|
||||
*
|
||||
* Input Parameters:
|
||||
* tcb - Address of the TCB initialized by task_init()
|
||||
*
|
||||
* Returned Value:
|
||||
* OK on success; negative error value on failure appropriately.
|
||||
*
|
||||
********************************************************************************/
|
||||
|
||||
void nxtask_uninit(FAR struct tcb_s *tcb);
|
||||
|
||||
/********************************************************************************
|
||||
* Name: nxtask_activate
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user