X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=tests%2Ftest_urcu_defer.c;h=309c3b2767d327f3691cae01fc6f3de2e2927921;hb=94b343fd8d68512d78d8646c646c15a1b3f84186;hp=e56dffe2e308374dad1554b32013e3718309f4f1;hpb=786ee85b1676d2a1865b2db7120c45bafdf954d6;p=urcu.git diff --git a/tests/test_urcu_defer.c b/tests/test_urcu_defer.c index e56dffe..309c3b2 100644 --- a/tests/test_urcu_defer.c +++ b/tests/test_urcu_defer.c @@ -32,11 +32,9 @@ #include #include #include +#include -#include "../arch.h" - -/* Make this big enough to include the POWER5+ L3 cacheline size of 256B */ -#define CACHE_LINE_SIZE 4096 +#include /* 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 +#include 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); + call_rcu(free, old); + call_rcu(test_cb1, old); + call_rcu(test_cb1, (void *)-2L); + call_rcu(test_cb1, (void *)-2L); + call_rcu(test_cb1, old); + call_rcu(test_cb2, (void *)-2L); + call_rcu(test_cb2, (void *)-4L); + call_rcu(test_cb2, (void *)-2L); nr_writes++; if (unlikely(!test_duration_write())) break;