X-Git-Url: https://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=tests%2Fbenchmark%2Ftest_urcu_assign.c;h=88889a89d0421097b90177f1853f7ac3fa5cb0db;hp=7f04927c825ba062d5393b599cd9ee9d5ed61169;hb=014775106c60f02818ca755b331f887030bd440f;hpb=70469b43316ecc8d6053550504858ad8a8ef9b16 diff --git a/tests/benchmark/test_urcu_assign.c b/tests/benchmark/test_urcu_assign.c index 7f04927..88889a8 100644 --- a/tests/benchmark/test_urcu_assign.c +++ b/tests/benchmark/test_urcu_assign.c @@ -28,10 +28,10 @@ #include #include #include -#include #include #include +#include #include #include "thread-id.h" #include "../common/debug-yield.h" @@ -84,7 +84,7 @@ pthread_mutex_t affinity_mutex = PTHREAD_MUTEX_INITIALIZER; static void set_affinity(void) { -#if HAVE_SCHED_SETAFFINITY +#ifdef HAVE_SCHED_SETAFFINITY cpu_set_t mask; int cpu, ret; #endif /* HAVE_SCHED_SETAFFINITY */ @@ -92,7 +92,7 @@ static void set_affinity(void) if (!use_affinity) return; -#if HAVE_SCHED_SETAFFINITY +#ifdef HAVE_SCHED_SETAFFINITY ret = pthread_mutex_lock(&affinity_mutex); if (ret) { perror("Error in pthread mutex lock"); @@ -172,7 +172,7 @@ static struct test_array *test_array_alloc(void) int index; index = array_index % ARRAY_SIZE; - assert(test_array[index].a == ARRAY_POISON || + urcu_posix_assert(test_array[index].a == ARRAY_POISON || test_array[index].a == 0); ret = &test_array[index]; array_index++; @@ -211,7 +211,7 @@ void *thr_reader(void *_count) local_ptr = rcu_dereference(test_rcu_pointer); rcu_debug_yield_read(); if (local_ptr) - assert(local_ptr->a == 8); + urcu_posix_assert(local_ptr->a == 8); if (caa_unlikely(rduration)) loop_sleep(rduration); rcu_read_unlock();