X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=tests%2Ftest_urcu.c;h=5059ddeac51648b5f901cdb5c3a1483aac7a1480;hb=d89f0c51ed502c4248211eb43292e92a98ffe31b;hp=87972aa9b4f01af92dec9e868ccba09d10ee3983;hpb=bcc74df39fa57a21aa977ef14e02ed8ab13c37e2;p=urcu.git diff --git a/tests/test_urcu.c b/tests/test_urcu.c index 87972aa..5059dde 100644 --- a/tests/test_urcu.c +++ b/tests/test_urcu.c @@ -31,11 +31,11 @@ #include #include #include -#include #include #include #include +#include "cpuset.h" #ifdef __linux__ #include @@ -100,12 +100,6 @@ static int use_affinity = 0; 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 @@ -193,6 +187,7 @@ void *thr_reader(void *_count) set_affinity(); rcu_register_thread(); + assert(!rcu_read_ongoing()); while (!test_go) { @@ -201,6 +196,7 @@ void *thr_reader(void *_count) for (;;) { rcu_read_lock(); + assert(rcu_read_ongoing()); local_ptr = rcu_dereference(test_rcu_pointer); rcu_debug_yield_read(); if (local_ptr)