X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=tests%2Ftest_urcu_hash.h;h=4af34f7a3499cb9fdec2d9681f33edfde35d93fa;hb=b5002bee0cfd9fab20edc7d2bfaa9d0c75628f5b;hp=083e71c3185214b7f81dd607a5705217bd2705bb;hpb=495913bfaec0ff19107f0cc903ba1d6eade03709;p=urcu.git diff --git a/tests/test_urcu_hash.h b/tests/test_urcu_hash.h index 083e71c..4af34f7 100644 --- a/tests/test_urcu_hash.h +++ b/tests/test_urcu_hash.h @@ -37,6 +37,8 @@ #include #include +#include + #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; @@ -173,9 +175,9 @@ extern unsigned long nr_hash_chains; extern int count_pipe[2]; -static inline void loop_sleep(unsigned long l) +static inline void loop_sleep(unsigned long loops) { - while(l-- != 0) + while (loops-- != 0) caa_cpu_relax(); } @@ -214,8 +216,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;