edits
[cdsspec-compiler.git] / benchmark / ms-queue / my_queue.c
index 9cd2f8e..145c91d 100644 (file)
@@ -104,6 +104,7 @@ void enqueue(queue_t *q, unsigned int val)
        atomic_store_explicit(&q->nodes[node].next, tmp, relaxed);
 
        while (!success) {
+               
                /**
                        @Begin
                        @Commit_point_clear: true
@@ -129,7 +130,7 @@ void enqueue(queue_t *q, unsigned int val)
                                /**
                                        @Begin
                                        @Commit_point_define_check: success
-                                       @Label: Enqueue_Update_Next
+                                       @Label: EnqueueUpdateNext
                                        @End
                                */
                        }
@@ -158,13 +159,6 @@ void enqueue(queue_t *q, unsigned int val)
                        &tail,
                        MAKE_POINTER(node, get_count(tail) + 1),
                        release, relaxed);
-       /**
-               @Begin
-               @Commit_point_define_check: true
-               @Label: Enqueue_Update_Tail
-               @End
-       */
-
 }
 
 /**
@@ -189,30 +183,18 @@ bool dequeue(queue_t *q, int *retVal)
                */
                /**** detected correctness error ****/
                head = atomic_load_explicit(&q->head, acquire);
-               /**
-                       @Begin
-                       @Commit_point_define_check: true
-                       @Label: Dequeue_Read_Head
-                       @End
-               */
                /** A new bug has been found here!!! It should be acquire instead of
                 * relaxed (it introduces a bug when there's two dequeuers and one
                 * enqueuer) correctness bug!!
                 */
                tail = atomic_load_explicit(&q->tail, acquire);
-               /**
-                       @Begin
-                       @Potential_commit_point_define: true
-                       @Label: Dequeue_Potential_Read_Tail
-                       @End
-               */
 
                /**** Detected UL/DR (testcase1.c) ****/
                next = atomic_load_explicit(&q->nodes[get_ptr(head)].next, acquire);
                /**
                        @Begin
                        @Potential_commit_point_define: true
-                       @Label: Dequeue_Potential_Read_Next
+                       @Label: DequeueReadNext
                        @End
                */
                if (atomic_load_explicit(&q->head, relaxed) == head) {
@@ -244,11 +226,18 @@ bool dequeue(queue_t *q, int *retVal)
                                                &head,
                                                MAKE_POINTER(get_ptr(next), get_count(head) + 1),
                                                release, relaxed);
+                               /**
+                                       @Begin
+                                       @Commit_point_define_check: success
+                                       @Label: DequeueUpdateHead
+                                       @End
+                               */
+
                                /**
                                        @Begin
                                        @Commit_point_define: success
-                                       @Potential_commit_point_label: Dequeue_Potential_Read_Next
-                                       @Label: Dequeue_Read_Next
+                                       @Potential_commit_point_label: DequeueReadNext
+                                       @Label: DequeueReadNextVerify
                                        @End
                                */
                                if (!success)