tests: only include syscall.h on linux systems
[urcu.git] / tests / test_urcu_lfq.c
index 15023f6fcb0011f1e8db81dcf925a06fed32dc96..cb50586ec3176ea6b4e3b100c8ba156d97295c38 100644 (file)
 #include <unistd.h>
 #include <stdio.h>
 #include <assert.h>
-#include <sys/syscall.h>
 #include <sched.h>
 #include <errno.h>
 
 #include <urcu/arch.h>
 
+#ifdef __linux__
+#include <syscall.h>
+#endif
+
 /* hardcoded number of CPUs */
 #define NR_CPUS 16384
 
@@ -62,8 +65,7 @@ static inline pid_t gettid(void)
 #define _LGPL_SOURCE
 #endif
 #include <urcu.h>
-#include <urcu/rculfqueue.h>
-#include <urcu-defer.h>
+#include <urcu/cds.h>
 
 static volatile int test_go, test_stop;
 
@@ -226,11 +228,6 @@ void *thr_dequeuer(void *_count)
 
        set_affinity();
 
-       ret = rcu_defer_register_thread();
-       if (ret) {
-               printf("Error in rcu_defer_register_thread\n");
-               exit(-1);
-       }
        rcu_register_thread();
 
        while (!test_go)
@@ -258,8 +255,6 @@ void *thr_dequeuer(void *_count)
        }
 
        rcu_unregister_thread();
-       rcu_defer_unregister_thread();
-
        printf_verbose("dequeuer thread_end, thread id : %lx, tid %lu, "
                       "dequeues %llu, successful_dequeues %llu\n",
                       pthread_self(), (unsigned long)gettid(), nr_dequeues,
This page took 0.022781 seconds and 4 git commands to generate.