projects
/
urcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
api: make api_gcc.h a superset of the other headers
[urcu.git]
/
tests
/
api_gcc.h
diff --git
a/tests/api_gcc.h
b/tests/api_gcc.h
index 93b72442cab1f37dd7f7dd4b69560ed2e86a77ed..9874334b1bd4838a1263837a80db6afb46d8a8ba 100644
(file)
--- a/
tests/api_gcc.h
+++ b/
tests/api_gcc.h
@@
-27,6
+27,8
@@
* 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
@@
-162,8
+164,8
@@
typedef pthread_t thread_id_t;
#define NR_THREADS 128
#define NR_THREADS 128
-#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;
@@
-175,6
+177,11
@@
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)
This page took
0.022376 seconds
and
4
git commands to generate.