X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=tests%2Ftest_qsbr_timing.c;h=969b802106da801750f39a5e02b1ab05c74c3348;hb=40646e1ec30a2fa5d289175643c1d1343e2f9b77;hp=2a8963a3dc315110d6f94e6ffba0c21d531c4fd7;hpb=833dbdb633ba44bfb71b4b965a83096d8e4e827b;p=urcu.git diff --git a/tests/test_qsbr_timing.c b/tests/test_qsbr_timing.c index 2a8963a..969b802 100644 --- a/tests/test_qsbr_timing.c +++ b/tests/test_qsbr_timing.c @@ -30,10 +30,7 @@ #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 #if defined(_syscall0) _syscall0(pid_t, gettid) @@ -51,7 +48,7 @@ static inline pid_t gettid(void) #endif #define _LGPL_SOURCE -#include "../urcu-qsbr.h" +#include pthread_mutex_t rcu_copy_mutex = PTHREAD_MUTEX_INITIALIZER; @@ -156,8 +153,9 @@ void *thr_writer(void *arg) assert(old->a == 8); } new->a = 8; - old = _rcu_publish_content(&test_rcu_pointer, new); + old = rcu_xchg_pointer(&test_rcu_pointer, new); rcu_copy_mutex_unlock(); + synchronize_rcu(); /* can be done after unlock */ if (old) { old->a = 0;