X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=tests%2Ftest_urcu.c;h=42892165fce3238564580f2407f4f1922f179f5a;hb=c96a37267efd57cddf7a30f472f9e56f2ecddddc;hp=18683bf3928972cdc6cec5cfaacc753596a4f9a3;hpb=833dbdb633ba44bfb71b4b965a83096d8e4e827b;p=urcu.git diff --git a/tests/test_urcu.c b/tests/test_urcu.c index 18683bf..4289216 100644 --- a/tests/test_urcu.c +++ b/tests/test_urcu.c @@ -33,10 +33,7 @@ #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,7 +58,7 @@ static inline pid_t gettid(void) #else #define debug_yield_read() #endif -#include "../urcu.h" +#include struct test_array { int a; @@ -259,7 +256,8 @@ void *thr_writer(void *_count) for (;;) { new = test_array_alloc(); new->a = 8; - old = rcu_publish_content(&test_rcu_pointer, new); + old = rcu_xchg_pointer(&test_rcu_pointer, new); + synchronize_rcu(); if (old) old->a = 0; test_array_free(old);