summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
901bbb4)
After this patch the only differences are:
- for_each_tid is now defined in api_x86.h
- HAVE_CPU_SET_T and HAVE_SCHED_SETAFFINITY are now defined in api_ppc.h
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
* to redistribute under later versions of GPL might not be available.
*/
* to redistribute under later versions of GPL might not be available.
*/
+#include <urcu/arch.h>
+
#ifndef __always_inline
#define __always_inline inline
#endif
#ifndef __always_inline
#define __always_inline inline
#endif
-#define __THREAD_ID_MAP_EMPTY 0
-#define __THREAD_ID_MAP_WAITING 1
+#define __THREAD_ID_MAP_EMPTY ((thread_id_t) 0)
+#define __THREAD_ID_MAP_WAITING ((thread_id_t) 1)
thread_id_t __thread_id_map[NR_THREADS];
spinlock_t __thread_id_map_mutex;
thread_id_t __thread_id_map[NR_THREADS];
spinlock_t __thread_id_map_mutex;
if ((__thread_id_map[t] != __THREAD_ID_MAP_EMPTY) && \
(__thread_id_map[t] != __THREAD_ID_MAP_WAITING))
if ((__thread_id_map[t] != __THREAD_ID_MAP_EMPTY) && \
(__thread_id_map[t] != __THREAD_ID_MAP_WAITING))
+#define for_each_tid(t, tid) \
+ for (t = 0; t < NR_THREADS; t++) \
+ if ((((tid) = __thread_id_map[t]) != __THREAD_ID_MAP_EMPTY) && \
+ ((tid) != __THREAD_ID_MAP_WAITING))
+
pthread_key_t thread_id_key;
static int __smp_thread_id(void)
pthread_key_t thread_id_key;
static int __smp_thread_id(void)
#define ____cacheline_internodealigned_in_smp \
__attribute__((__aligned__(CAA_CACHE_LINE_SIZE)))
#define ____cacheline_internodealigned_in_smp \
__attribute__((__aligned__(CAA_CACHE_LINE_SIZE)))