diff options
Diffstat (limited to 'nuttx/sched')
-rw-r--r-- | nuttx/sched/task_delete.c | 7 | ||||
-rw-r--r-- | nuttx/sched/task_exithook.c | 4 |
2 files changed, 7 insertions, 4 deletions
diff --git a/nuttx/sched/task_delete.c b/nuttx/sched/task_delete.c index e5244a0b8..5448260d5 100644 --- a/nuttx/sched/task_delete.c +++ b/nuttx/sched/task_delete.c @@ -179,6 +179,13 @@ int task_delete(pid_t pid) sched_unlock(); + /* Since all tasks pass through this function as the final step in their + * exit sequence, this is an appropriate place to inform any instrumentation + * layer that the task no longer exists. + */ + + sched_note_stop(tcb); + /* Deallocate its TCB */ sched_releasetcb(dtcb); diff --git a/nuttx/sched/task_exithook.c b/nuttx/sched/task_exithook.c index e160a1cb3..500129382 100644 --- a/nuttx/sched/task_exithook.c +++ b/nuttx/sched/task_exithook.c @@ -102,10 +102,6 @@ void task_exithook(FAR _TCB *tcb, int status) { - /* Inform the instrumentation layer that the task has stopped */ - - sched_note_stop(tcb); - /* If an exit function was registered, call it now before we do any un- * initialized. NOTE: In the case of task_delete(), the exit function * will *not* be called on the thread execution of the task being deleted! |