X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=tests%2Ftest_urcu_hash.h;h=eaf1d791487aadc5493abf8effbb4885b2171139;hb=95d8822d8b4c4a3563bf51c7c718350eb2babd20;hp=083e71c3185214b7f81dd607a5705217bd2705bb;hpb=495913bfaec0ff19107f0cc903ba1d6eade03709;p=userspace-rcu.git diff --git a/tests/test_urcu_hash.h b/tests/test_urcu_hash.h index 083e71c..eaf1d79 100644 --- a/tests/test_urcu_hash.h +++ b/tests/test_urcu_hash.h @@ -33,10 +33,12 @@ #include #include #include -#include #include #include +#include +#include "cpuset.h" + #ifdef __linux__ #include #endif @@ -102,13 +104,13 @@ struct wr_count { unsigned long remove; }; -extern unsigned int __thread rand_lookup; -extern unsigned long __thread nr_add; -extern unsigned long __thread nr_addexist; -extern unsigned long __thread nr_del; -extern unsigned long __thread nr_delnoent; -extern unsigned long __thread lookup_fail; -extern unsigned long __thread lookup_ok; +extern DECLARE_URCU_TLS(unsigned int, rand_lookup); +extern DECLARE_URCU_TLS(unsigned long, nr_add); +extern DECLARE_URCU_TLS(unsigned long, nr_addexist); +extern DECLARE_URCU_TLS(unsigned long, nr_del); +extern DECLARE_URCU_TLS(unsigned long, nr_delnoent); +extern DECLARE_URCU_TLS(unsigned long, lookup_fail); +extern DECLARE_URCU_TLS(unsigned long, lookup_ok); extern struct cds_lfht *test_ht; @@ -193,12 +195,6 @@ extern int use_affinity; extern pthread_mutex_t affinity_mutex; -#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 - void set_affinity(void); /* @@ -214,8 +210,8 @@ static inline int test_duration_read(void) return !test_stop; } -extern unsigned long long __thread nr_writes; -extern unsigned long long __thread nr_reads; +extern DECLARE_URCU_TLS(unsigned long long, nr_writes); +extern DECLARE_URCU_TLS(unsigned long long, nr_reads); extern unsigned int nr_readers; extern unsigned int nr_writers;