Add `urcu_posix_assert()` as `assert()` replacement
[urcu.git] / tests / benchmark / test_mutex.c
index e06b902c1c54b2e871e2f4fa0ecfb42846e94e8e..55f7c38f21bf66f2d8ad7dbb91cb778256b6ccb4 100644 (file)
 #include <sys/wait.h>
 #include <unistd.h>
 #include <stdio.h>
-#include <assert.h>
 #include <errno.h>
 
 #include <urcu/arch.h>
+#include <urcu/assert.h>
 #include <urcu/tls-compat.h>
 #include "thread-id.h"
 
@@ -85,7 +85,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 */
@@ -93,7 +93,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");
@@ -156,7 +156,7 @@ void *thr_reader(void *data)
 
                pthread_mutex_lock(&lock);
                v = test_array.a;
-               assert(v == 8);
+               urcu_posix_assert(v == 8);
                if (caa_unlikely(rduration))
                        loop_sleep(rduration);
                pthread_mutex_unlock(&lock);
This page took 0.022954 seconds and 4 git commands to generate.