m68k: add NPTL/TLS support
[uclibc-ng.git] / libpthread / nptl / sysdeps / unix / sysv / linux / m68k / sysdep-cancel.h
blob34c43b06dd20fbcc5b8565c595db27854740667f
1 #include <sysdep.h>
2 #include <tls.h>
3 #ifndef __ASSEMBLER__
4 #include <pthreadP.h>
5 #endif
7 #if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
9 # ifdef IS_IN_libpthread
10 # define __local_multiple_threads __pthread_multiple_threads
11 # elif !defined NOT_IN_libc
12 # define __local_multiple_threads __libc_multiple_threads
13 # endif
15 # if defined IS_IN_libpthread || !defined NOT_IN_libc
16 extern int __local_multiple_threads attribute_hidden;
17 # define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
18 # else
19 # define SINGLE_THREAD_P \
20 __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
21 header.multiple_threads) == 0, 1)
22 # endif
24 #else
26 # define SINGLE_THREAD_P 1
27 # define NO_CANCELLATION 1
29 #endif
31 #define RTLD_SINGLE_THREAD_P \
32 __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
33 header.multiple_threads) == 0, 1)