diff options
Diffstat (limited to 'nuttx/sched')
-rw-r--r-- | nuttx/sched/task_delete.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/nuttx/sched/task_delete.c b/nuttx/sched/task_delete.c index 4f463bd60..86a796ab7 100644 --- a/nuttx/sched/task_delete.c +++ b/nuttx/sched/task_delete.c @@ -118,10 +118,12 @@ STATUS task_delete(pid_t pid) /* Make sure the task does not become ready-to-run while * we are futzing with its TCB by locking ourselves as the * executing task. - * - * Frist, find for the TCB associated with matching pid */ + sched_lock(); + + /* Find for the TCB associated with matching pid */ + dtcb = sched_gettcb(pid); if (!dtcb) { |