sysdep-cancel.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Copyright (C) 2016-2017 Andes Technology, Inc.
  3. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  4. */
  5. /* Copyright (C) 2003-2013 Free Software Foundation, Inc.
  6. The GNU C Library is free software; you can redistribute it and/or
  7. modify it under the terms of the GNU Lesser General Public
  8. License as published by the Free Software Foundation; either
  9. version 2.1 of the License, or (at your option) any later version.
  10. The GNU C Library is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. Lesser General Public License for more details.
  14. You should have received a copy of the GNU Lesser General Public
  15. License along with the GNU C Library. If not, see
  16. <http://www.gnu.org/licenses/>. */
  17. #include <sysdep.h>
  18. #include <tls.h>
  19. #ifndef __ASSEMBLER__
  20. # include <pthreadP.h>
  21. #endif
  22. #if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
  23. # define SINGLE_THREAD_P __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
  24. header.multiple_threads) == 0, 1)
  25. #else
  26. /* For rtld, et cetera. */
  27. # define SINGLE_THREAD_P 1
  28. # define NO_CANCELLATION 1
  29. #endif
  30. #define RTLD_SINGLE_THREAD_P \
  31. __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
  32. header.multiple_threads) == 0, 1)