X-Git-Url: https://git.lttng.org/?p=urcu.git;a=blobdiff_plain;f=tests%2Ftest_urcu_timing.c;h=94ac0ae4dff32043d45f7bab97d629665d4932aa;hp=a3ca783a35a806daae65f914fec9bec2c2f0ab58;hb=6982d6d71aeed16d2d929bd0ed221e8f444b706e;hpb=833dbdb633ba44bfb71b4b965a83096d8e4e827b diff --git a/tests/test_urcu_timing.c b/tests/test_urcu_timing.c index a3ca783..94ac0ae 100644 --- a/tests/test_urcu_timing.c +++ b/tests/test_urcu_timing.c @@ -3,7 +3,7 @@ * * Userspace RCU library - test program * - * Copyright February 2009 - Mathieu Desnoyers + * Copyright February 2009 - Mathieu Desnoyers * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,10 +30,8 @@ #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 +#include #if defined(_syscall0) _syscall0(pid_t, gettid) @@ -51,7 +49,7 @@ static inline pid_t gettid(void) #endif #define _LGPL_SOURCE -#include "../urcu.h" +#include pthread_mutex_t rcu_copy_mutex = PTHREAD_MUTEX_INITIALIZER; @@ -155,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;