#include <stdio.h>
#include <assert.h>
#include <sys/syscall.h>
-#include "../arch.h"
-
-/* Make this big enough to include the POWER5+ L3 cacheline size of 256B */
-#define CACHE_LINE_SIZE 4096
+#include <errno.h>
+#include <urcu/arch.h>
#if defined(_syscall0)
_syscall0(pid_t, gettid)
#endif
#define _LGPL_SOURCE
-#include "../urcu.h"
+#include <urcu.h>
pthread_mutex_t rcu_copy_mutex = PTHREAD_MUTEX_INITIALIZER;
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;