sysdep-cancel.h 871 B

123456789101112131415161718192021222324252627282930313233
  1. #include <sysdep.h>
  2. #include <tls.h>
  3. #ifndef __ASSEMBLER__
  4. #include <pthreadP.h>
  5. #endif
  6. #if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
  7. # ifdef IS_IN_libpthread
  8. # define __local_multiple_threads __pthread_multiple_threads
  9. # elif !defined NOT_IN_libc
  10. # define __local_multiple_threads __libc_multiple_threads
  11. # endif
  12. # if defined IS_IN_libpthread || !defined NOT_IN_libc
  13. extern int __local_multiple_threads attribute_hidden;
  14. # define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
  15. # else
  16. # define SINGLE_THREAD_P \
  17. __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
  18. header.multiple_threads) == 0, 1)
  19. # endif
  20. #else
  21. # define SINGLE_THREAD_P 1
  22. # define NO_CANCELLATION 1
  23. #endif
  24. #define RTLD_SINGLE_THREAD_P \
  25. __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
  26. header.multiple_threads) == 0, 1)