summaryrefslogtreecommitdiff
path: root/nuttx/arch/dm320
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-03-29 13:26:24 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-03-29 13:26:24 +0000
commitb47669c88a2bf61807881482f271ca3928c32530 (patch)
tree91118c96b10a576b9bc37b57bb10246b9399e1e2 /nuttx/arch/dm320
parent605bd84ced2cf37e267eccf604bdff1a985a65d8 (diff)
downloadpx4-nuttx-b47669c88a2bf61807881482f271ca3928c32530.tar.gz
px4-nuttx-b47669c88a2bf61807881482f271ca3928c32530.tar.bz2
px4-nuttx-b47669c88a2bf61807881482f271ca3928c32530.zip
task_delete() calls sched_unlock(); _exit must keep pre-emption disabled until pending queue emptied.
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@167 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/dm320')
-rw-r--r--nuttx/arch/dm320/src/up_exit.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/nuttx/arch/dm320/src/up_exit.c b/nuttx/arch/dm320/src/up_exit.c
index e51180dc6..bb05b1c53 100644
--- a/nuttx/arch/dm320/src/up_exit.c
+++ b/nuttx/arch/dm320/src/up_exit.c
@@ -149,6 +149,13 @@ void _exit(int status)
(void)sched_removereadytorun(tcb);
+ /* We are not in a bad stack-- the head of the ready to run task list
+ * does not correspond to the thread that is running. Disabling pre-
+ * emption on this TCB should be enough to keep things stable.
+ */
+
+ sched_lock();
+
/* Move the TCB to the specified blocked task list and delete it */
sched_addblocked(tcb, TSTATE_TASK_INACTIVE);
@@ -163,6 +170,10 @@ void _exit(int status)
(void)sched_mergepending();
}
+ /* Now calling sched_unlock() should have no effect */
+
+ sched_unlock();
+
/* Now, perform the context switch to the new ready-to-run task at the
* head of the list.
*/