Add `urcu_posix_assert()` as `assert()` replacement
[urcu.git] / tests / benchmark / test_urcu_lfq.c
index eb97b1ae1062548c8092bf289e10984694e45420..490e8b0527154f3f55edcf9beb0c44e0a1080aa5 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"
 
@@ -78,7 +78,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 */
@@ -86,7 +86,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");
@@ -404,7 +404,7 @@ int main(int argc, char **argv)
 
        test_end(&end_dequeues);
        err = cds_lfq_destroy_rcu(&q);
-       assert(!err);
+       urcu_posix_assert(!err);
 
        printf_verbose("total number of enqueues : %llu, dequeues %llu\n",
                       tot_enqueues, tot_dequeues);
This page took 0.0229 seconds and 4 git commands to generate.