mirror of
https://github.com/apache/nuttx.git
synced 2026-06-08 10:32:47 +08:00
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:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user