[Cbe-oss-dev] [PATCH 4/10] MARS: task barrier fix notify

Yuji Mano Yuji.Mano at am.sony.com
Thu Aug 28 05:26:01 EST 2008


This fixes a bug in task barrier's notify function so it only sends a signal to
workload id's that are in the wait list.

This also fixes a bug where the barrier count was not being properly reset once
the barrier is released.

Signed-off-by: Yuji Mano <yuji.mano at am.sony.com>

---
 src/mpu/lib/mars_task_barrier.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/src/mpu/lib/mars_task_barrier.c
+++ b/src/mpu/lib/mars_task_barrier.c
@@ -80,11 +80,14 @@ int mars_task_barrier_notify(uint64_t ba
 	/* barrier count reached total so release barrier */
 	if (barrier.count == barrier.total) {
 		/* signal all task ids in wait list */
-		for (i = 0; i < barrier.total; i++)
+		for (i = 0; i < barrier.wait_count; i++)
 			mars_signal_send(barrier.wait_id[i]);
 
 		/* flush wait list */
 		barrier.wait_count = 0;
+
+		/* reset barrier count */
+		barrier.count = 0;
 	}
 
 	mars_mutex_unlock_put(barrier_ea, (struct mars_mutex *)&barrier);






More information about the cbe-oss-dev mailing list