update Makefile, -Wall
[urcu.git] / test_urcu.c
index 650c030efece587c4eed2a47fb2fb67aa9fc3eb7..17061f81a250d5f12f7e4836d7caf81835cd43d4 100644 (file)
@@ -1,3 +1,13 @@
+/*
+ * test_urcu.c
+ *
+ * Userspace RCU library - test program
+ *
+ * Copyright February 2009 - Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
+ *
+ * Distributed under GPLv2
+ */
+
 #include <stdio.h>
 #include <pthread.h>
 #include <stdlib.h>
@@ -27,7 +37,7 @@ void *thr_reader(void *arg)
        struct test_array *local_ptr;
 
        printf("thread %s, thread id : %lu, pid %lu\n",
-                       "reader", pthread_self(), getpid());
+                       "reader", pthread_self(), (unsigned long)getpid());
        sleep(2);
 
        urcu_register_thread();
@@ -57,7 +67,7 @@ void *thr_writer(void *arg)
        struct test_array *new, *old;
 
        printf("thread %s, thread id : %lu, pid %lu\n",
-                       "writer", pthread_self(), getpid());
+                       "writer", pthread_self(), (unsigned long)getpid());
        sleep(2);
 
        for (i = 0; i < 100000; i++) {
@@ -72,7 +82,7 @@ void *thr_writer(void *arg)
                new->a = 8;
                new->b = 12;
                new->c[55] = 2;
-               old = urcu_publish_content(&test_rcu_pointer, new);
+               old = urcu_publish_content((void **)&test_rcu_pointer, new);
                rcu_write_unlock();
                /* can be done after unlock */
                if (old) {
This page took 0.023492 seconds and 4 git commands to generate.