[Cbe-oss-dev] [PATCH 15/23]MARS/task: initialize exit code

Yuji Mano yuji.mano at am.sony.com
Sat Mar 14 12:18:50 EST 2009


This patch makes sure the task context's exit_code is initialized at both task
creation and scheduling for cases where a task is waited on without it ever
being executed.

Signed-off-by: Yuji Mano <yuji.mano at am.sony.com>
---
 task/src/host/lib/task.c          |    4 ++++
 task/src/mpu/module/task_module.c |    1 +
 2 files changed, 5 insertions(+)

--- a/task/src/host/lib/task.c
+++ b/task/src/host/lib/task.c
@@ -139,6 +139,9 @@ int mars_task_create(struct mars_context
 	else
 		task->id.name[0] = 0;
 
+	/* initialize task exit code */
+	task->exit_code = 0;
+
 	/* no context save - run complete */
 	if (!context_save_size) {
 		task->context_save_area_ea = 0;
@@ -260,6 +263,7 @@ int mars_task_schedule(struct mars_task_
 
 	/* initialize task specific context variables */
 	task->stack = 0;
+	task->exit_code = 0;
 	if (args)
 		memcpy(&task->args, args, sizeof(struct mars_task_args));
 
--- a/task/src/mpu/module/task_module.c
+++ b/task/src/mpu/module/task_module.c
@@ -353,6 +353,7 @@ static int task_schedule(uint16_t worklo
 
 	/* initialize task specific context variables */
 	schedule_task->stack = 0;
+	schedule_task->exit_code = 0;
 	if (args)
 		schedule_task->args = *args;
 






More information about the cbe-oss-dev mailing list