summaryrefslogtreecommitdiff
path: root/nuttx/sched/task_delete.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-05-28 21:42:18 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-05-28 21:42:18 +0000
commit94c7babe23d72a1e379da0cf0aab32fcf9fadcf3 (patch)
treeeedc930a4ed4a1108c87cae26d3fcda7e411dd1f /nuttx/sched/task_delete.c
parent405c2b328ff4cd571bb9e464541b4d297b18f93d (diff)
downloadpx4-nuttx-94c7babe23d72a1e379da0cf0aab32fcf9fadcf3.tar.gz
px4-nuttx-94c7babe23d72a1e379da0cf0aab32fcf9fadcf3.tar.bz2
px4-nuttx-94c7babe23d72a1e379da0cf0aab32fcf9fadcf3.zip
atexit() functions now called when task killed by task delete; For MCUs with <= 64Kb of SRAM, CONFIG_MM_SMALL can be defined to reduce the memory allocation overhead
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3648 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched/task_delete.c')
-rw-r--r--nuttx/sched/task_delete.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/nuttx/sched/task_delete.c b/nuttx/sched/task_delete.c
index 4fd49a4ea..51b3e30da 100644
--- a/nuttx/sched/task_delete.c
+++ b/nuttx/sched/task_delete.c
@@ -140,14 +140,9 @@ int task_delete(pid_t pid)
PANIC(OSERR_BADDELETESTATE);
}
- saved_state = irqsave();
-
- /* Inform the instrumentation layer that the task has stopped */
-
- sched_note_stop(dtcb);
-
/* Remove the task from the OS's tasks lists. */
+ saved_state = irqsave();
dq_rem((FAR dq_entry_t*)dtcb, (dq_queue_t*)g_tasklisttable[dtcb->task_state].list);
dtcb->task_state = TSTATE_TASK_INVALID;
irqrestore(saved_state);
@@ -156,11 +151,12 @@ int task_delete(pid_t pid)
sched_unlock();
- /* Deallocate anything left in the TCB's queues */
+ /* Perform common task termination logic (flushing streams, calling
+ * functions registered by at_exit/on_exit, etc.). I suppose EXIT_SUCCESS
+ * is an appropriate return value???
+ */
-#ifndef CONFIG_DISABLE_SIGNALS
- sig_cleanup(dtcb); /* Deallocate Signal lists */
-#endif
+ task_exithook(dtcb, EXIT_SUCCESS);
/* Deallocate its TCB */