save
[cdsspec-compiler.git] / benchmark / read-copy-update / rcu.cc
index 44ce986..cc512d6 100644 (file)
@@ -53,7 +53,7 @@ atomic<Data*> data;
 
        @Happens_before:
                Write -> Read
-               //Write -> Write
+               Write -> Write
        @End
 */
 
@@ -107,7 +107,7 @@ Data* write(int d1, int d2, int d3) {
            tmp->data2 = prev->data2 + d2;
            tmp->data3 = prev->data3 + d3;
         succ = data.compare_exchange_strong(prev, tmp,
-            memory_order_release, memory_order_acquire);
+            memory_order_acq_rel, memory_order_acquire);
                /**
                        @Begin
                        @Commit_point_define_check: succ
@@ -149,7 +149,7 @@ int user_main(int argc, char **argv) {
        dataInit->data2 = 0;
        dataInit->data3 = 0;
        atomic_init(&data, dataInit);
-       //write(0, 0, 0);
+       write(0, 0, 0);
 
        thrd_create(&t1, threadA, NULL);
        thrd_create(&t2, threadB, NULL);