[rtems commit] smptests/smpatomic01: Fix seqlock write

Sebastian Huber sebh at rtems.org
Wed Jun 8 08:02:19 UTC 2016


Module:    rtems
Branch:    master
Commit:    4c19e59b5e512c8d7e07bce510cbb2b9f6f3e625
Changeset: http://git.rtems.org/rtems/commit/?id=4c19e59b5e512c8d7e07bce510cbb2b9f6f3e625

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Jun  8 10:01:44 2016 +0200

smptests/smpatomic01: Fix seqlock write

---

 testsuites/smptests/smpatomic01/init.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/testsuites/smptests/smpatomic01/init.c b/testsuites/smptests/smpatomic01/init.c
index 00a0cb5..007d012 100644
--- a/testsuites/smptests/smpatomic01/init.c
+++ b/testsuites/smptests/smpatomic01/init.c
@@ -648,7 +648,9 @@ static void test_single_writer_seqlock_body(
 
       seq = _Atomic_Load_ulong(&ctx->atomic_value, ATOMIC_ORDER_RELAXED);
       _Atomic_Store_ulong(&ctx->atomic_value, seq + 1, ATOMIC_ORDER_RELAXED);
-      _Atomic_Fence(ATOMIC_ORDER_ACQUIRE);
+
+      /* There is no atomic store with acquire/release semantics */
+      _Atomic_Fence(ATOMIC_ORDER_ACQ_REL);
 
       ++counter;
       ctx->normal_value = counter;



More information about the vc mailing list