urcu-defer: remove call_rcu() API, replace by defer_rcu()
[urcu.git] / tests / test_urcu_defer.c
index e56dffe2e308374dad1554b32013e3718309f4f1..72c598b40a0552f4b60b03ac38c511b417796c9b 100644 (file)
 #include <assert.h>
 #include <sys/syscall.h>
 #include <sched.h>
+#include <errno.h>
 
-#include "../arch.h"
-
-/* Make this big enough to include the POWER5+ L3 cacheline size of 256B */
-#define CACHE_LINE_SIZE 4096
+#include <urcu/arch.h>
 
 /* hardcoded number of CPUs */
 #define NR_CPUS 16384
@@ -61,8 +59,8 @@ static inline pid_t gettid(void)
 #else
 #define debug_yield_read()
 #endif
-#include "../urcu.h"
-#include "../urcu-defer.h"
+#include <urcu.h>
+#include <urcu-defer.h>
 
 struct test_array {
        int a;
@@ -209,6 +207,14 @@ void *thr_reader(void *_count)
 
 }
 
+static void test_cb2(void *data)
+{
+}
+
+static void test_cb1(void *data)
+{
+}
+
 void *thr_writer(void *data)
 {
        unsigned long wtidx = (unsigned long)data;
@@ -230,7 +236,14 @@ void *thr_writer(void *data)
                new = malloc(sizeof(*new));
                new->a = 8;
                old = rcu_xchg_pointer(&test_rcu_pointer, new);
-               rcu_defer_queue(old);
+               defer_rcu(free, old);
+               defer_rcu(test_cb1, old);
+               defer_rcu(test_cb1, (void *)-2L);
+               defer_rcu(test_cb1, (void *)-2L);
+               defer_rcu(test_cb1, old);
+               defer_rcu(test_cb2, (void *)-2L);
+               defer_rcu(test_cb2, (void *)-4L);
+               defer_rcu(test_cb2, (void *)-2L);
                nr_writes++;
                if (unlikely(!test_duration_write()))
                        break;
This page took 0.024326 seconds and 4 git commands to generate.