cleanup: explicitly mark unused parameters (-Wunused-parameter)
[urcu.git] / doc / examples / wfcqueue / cds_wfcq_enqueue.c
index b5dc1471f6bbcc109d300be81a3254456044ab3d..850eea8b5e5fa817fe8ef902d4f2144000b7c48c 100644 (file)
@@ -27,7 +27,7 @@ struct mynode {
        struct cds_wfcq_node node;      /* Chaining in queue */
 };
 
-int main(int argc, char **argv)
+int main(void)
 {
        int values[] = { -5, 42, 36, 24, };
        struct cds_wfcq_head myqueue_head;      /* Queue head */
@@ -39,8 +39,7 @@ int main(int argc, char **argv)
        cds_wfcq_init(&myqueue_head, &myqueue_tail);
 
        /*
-        * Adding nodes to the linked-list. Safe against concurrent
-        * RCU traversals, require mutual exclusion with list updates.
+        * Enqueue nodes.
         */
        for (i = 0; i < CAA_ARRAY_SIZE(values); i++) {
                struct mynode *node;
@@ -58,7 +57,8 @@ int main(int argc, char **argv)
        }
 
        /*
-        * Show the queue content.
+        * Show the queue content, iterate in the same order nodes were
+        * enqueued, from oldest to newest.
         */
        printf("myqueue content:");
        __cds_wfcq_for_each_blocking(&myqueue_head, &myqueue_tail, qnode) {
@@ -68,5 +68,6 @@ int main(int argc, char **argv)
        }
        printf("\n");
 end:
+       cds_wfcq_destroy(&myqueue_head, &myqueue_tail);
        return ret;
 }
This page took 0.022795 seconds and 4 git commands to generate.