#include <unistd.h>
#include <stdio.h>
#include <assert.h>
-#include <sched.h>
#include <errno.h>
#include <urcu/arch.h>
#include <urcu/tls-compat.h>
+#include "cpuset.h"
#ifdef __linux__
#include <syscall.h>
pthread_mutex_t affinity_mutex = PTHREAD_MUTEX_INITIALIZER;
-#ifndef HAVE_CPU_SET_T
-typedef unsigned long cpu_set_t;
-# define CPU_ZERO(cpuset) do { *(cpuset) = 0; } while(0)
-# define CPU_SET(cpu, cpuset) do { *(cpuset) |= (1UL << (cpu)); } while(0)
-#endif
-
static void set_affinity(void)
{
#if HAVE_SCHED_SETAFFINITY
rcu_register_thread();
+ assert(rcu_read_ongoing());
+ rcu_thread_offline();
+ assert(!rcu_read_ongoing());
+ rcu_thread_online();
+
while (!test_go)
{
}
for (;;) {
rcu_read_lock();
+ assert(rcu_read_ongoing());
local_ptr = rcu_dereference(test_rcu_pointer);
rcu_debug_yield_read();
if (local_ptr)