Cleanup: doc/examples makefile
[urcu.git] / tests / api.h
index 6d7190086b1babef4610fd6ca349a1b096c78687..dced0d8d204e15b84252f1f374f7b5027d12490b 100644 (file)
@@ -29,6 +29,7 @@
 
 #include <urcu/compiler.h>
 #include <urcu/arch.h>
+#include "cpuset.h"
 
 /*
  * Machine parameters.
@@ -65,7 +66,6 @@
 #include <limits.h>
 #include <sys/types.h>
 #include <pthread.h>
-#include <sched.h>
 #include <sys/param.h>
 /* #include "atomic.h" */
 
@@ -151,9 +151,10 @@ static int __smp_thread_id(void)
        }
        spin_lock(&__thread_id_map_mutex);
        for (i = 0; i < NR_THREADS; i++) {
-               if (__thread_id_map[i] == tid)
+               if (__thread_id_map[i] == tid) {
                        spin_unlock(&__thread_id_map_mutex);
                        return i;
+               }
        }
        spin_unlock(&__thread_id_map_mutex);
        fprintf(stderr, "smp_thread_id: Rogue thread, id: %lu(%#lx)\n",
@@ -231,12 +232,6 @@ static void wait_all_threads(void)
        }
 }
 
-#ifndef HAVE_CPU_SET_T
-typedef unsigned long cpu_set_t;
-# define CPU_ZERO(cpuset) do { *(cpuset) = 0; } while(0)
-# define CPU_SET(cpu, cpuset) do { *(cpuset) |= (1UL << (cpu)); } while(0)
-#endif
-
 static void run_on(int cpu)
 {
 #if HAVE_SCHED_SETAFFINITY
This page took 0.025115 seconds and 4 git commands to generate.