add spsc
[cdsspec-compiler.git] / benchmark / ms-queue / my_queue.h
index d4999299351daa98109cf96b938cce0cdfeb1fd7..fa64d6083a7abb9f1e4f67568da97b1d51c0b149 100644 (file)
@@ -32,6 +32,8 @@ void init_queue(queue_t *q, int num_threads);
 
 /**
        @Begin
+       @Options:
+               LANG = C;
        @Global_define:
                @DeclareStruct:
                typedef struct tag_elem {
@@ -47,7 +49,7 @@ void init_queue(queue_t *q, int num_threads);
                        tag = new_id_tag(); // Beginning of available id
                @DefineFunc:
                        tag_elem_t* new_tag_elem(call_id_t id, unsigned int data) {
-                               tag_elem_t *e = (tag_elem_t*) MODEL_MALLOC(sizeof(tag_elem_t));
+                               tag_elem_t *e = (tag_elem_t*) CMODEL_MALLOC(sizeof(tag_elem_t));
                                e->id = id;
                                e->data = data;
                                return e;
@@ -78,7 +80,7 @@ void init_queue(queue_t *q, int num_threads);
        @Begin
        @Interface: Enqueue
        @Commit_point_set: Enqueue_Success_Point
-       @ID: get_and_inc(tag);
+       @ID: get_and_inc(tag)
        @Action:
                # __ID__ is an internal macro that refers to the id of the current
                # interface call
@@ -92,7 +94,7 @@ void enqueue(queue_t *q, unsigned int val);
        @Begin
        @Interface: Dequeue
        @Commit_point_set: Dequeue_Success_Point | Dequeue_Empty_Point
-       @ID: get_id(back(__queue))
+       @ID: get_id(front(__queue))
        @Action:
                unsigned int _Old_Val = get_data(front(__queue));
                pop_front(__queue);