sched: Remove task_delete in case of CONFIG_BUILD_KERNEL

Deleting a task from another task's context will not do, so shut
this gate down for BUILD_KERNEL. In this case if a task wants another
task to terminate, it must ask the other task to politely kill itself.

Note: kthreads still need this, also, the kernel can delete a task
without asking.
This commit is contained in:
Ville Juven
2022-05-11 09:03:04 +03:00
committed by Xiang Xiao
parent c39d3fa9e4
commit b1d92159fa
4 changed files with 117 additions and 86 deletions
+4 -5
View File
@@ -154,20 +154,19 @@ int kthread_create(FAR const char *name, int priority, int stack_size,
* function is equivalent to task_delete.c; the following definition
* simply reserves the name in the name space.
*
* Refer to comments with task_delete() for a more detailed description of
* the operation of this function.
* Refer to comments with nxtask_delete() for a more detailed description
* of the operation of this function.
*
* Input Parameters:
* pid - The task ID of the task to delete. A pid of zero
* signifies the calling task.
*
* Returned Value:
* OK on success; or ERROR on failure with the errno variable set
* appropriately.
* OK on success; or negated errno on failure.
*
****************************************************************************/
#define kthread_delete(p) task_delete(p)
#define kthread_delete(p) nxtask_delete(p)
#undef EXTERN
#ifdef __cplusplus
+2 -1
View File
@@ -92,10 +92,11 @@ SYSCALL_LOOKUP(sem_wait, 1)
#ifndef CONFIG_BUILD_KERNEL
SYSCALL_LOOKUP(task_create, 5)
SYSCALL_LOOKUP(task_spawn, 6)
SYSCALL_LOOKUP(task_delete, 1)
#else
SYSCALL_LOOKUP(pgalloc, 2)
#endif
SYSCALL_LOOKUP(task_delete, 1)
SYSCALL_LOOKUP(task_restart, 1)
SYSCALL_LOOKUP(task_setcancelstate, 2)
SYSCALL_LOOKUP(up_assert, 2)