[Cbe-oss-dev] [PATCH 3/5]MARS/base: workload queue exit lock header

Yuji Mano yuji.mano at am.sony.com
Tue Jun 16 10:04:02 EST 2009


This patch makes sure to lock the workload queue header when setting the exit
flag.

Signed-off-by: Yuji Mano <yuji.mano at am.sony.com>
---
 base/src/host/lib/workload_queue.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/base/src/host/lib/workload_queue.c
+++ b/base/src/host/lib/workload_queue.c
@@ -333,10 +333,14 @@ int mars_workload_queue_exit(struct mars
 
 	queue_ea = mars->workload_queue_ea;
 
+	mars_mutex_lock(queue_ea);
+
 	mars_ea_put_uint32(queue_ea +
 			   offsetof(struct mars_workload_queue_header, flag),
 			   MARS_WORKLOAD_QUEUE_FLAG_EXIT);
 
+	mars_mutex_unlock(queue_ea);
+
 	return MARS_SUCCESS;
 }
 






More information about the cbe-oss-dev mailing list