diff mbox

[v3,4/9] linux-generic: odp_barrier.c use __atomic

Message ID 1416868730-26140-5-git-send-email-ola.liljedahl@linaro.org
State Accepted
Commit 9fe348ddad05e929e9a51dc4e5fe3a54b3d46e9c
Headers show

Commit Message

Ola Liljedahl Nov. 24, 2014, 10:38 p.m. UTC
Signed-off-by: Ola Liljedahl <ola.liljedahl@linaro.org>
---
Updated to use GCC __atomic barriers. Restored missing line.

 platform/linux-generic/odp_barrier.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/platform/linux-generic/odp_barrier.c b/platform/linux-generic/odp_barrier.c
index 87be2a1..de1bf60 100644
--- a/platform/linux-generic/odp_barrier.c
+++ b/platform/linux-generic/odp_barrier.c
@@ -33,8 +33,8 @@  void odp_barrier_wait(odp_barrier_t *barrier)
 	uint32_t count;
 	int wasless;
 
-	odp_sync_stores();
 	wasless = barrier->bar < barrier->count;
+	__atomic_thread_fence(__ATOMIC_SEQ_CST);
 	count   = odp_atomic_fetch_inc_u32(&barrier->bar);
 
 	if (count == 2*barrier->count-1) {
@@ -44,5 +44,5 @@  void odp_barrier_wait(odp_barrier_t *barrier)
 			odp_spin();
 	}
 
-	odp_mem_barrier();
+	__atomic_thread_fence(__ATOMIC_SEQ_CST);
 }