boost_has_sched_yield.ipp 651 B

12345678910111213141516171819202122232425262728293031323334
  1. // (C) Copyright John Maddock 2001.
  2. // Use, modification and distribution are subject to the
  3. // Boost Software License, Version 1.0. (See accompanying file
  4. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. // See http://www.boost.org/libs/config for most recent version.
  6. // MACRO: BOOST_HAS_SCHED_YIELD
  7. // TITLE: sched_yield
  8. // DESCRIPTION: The platform supports POSIX standard API sched_yield.
  9. #include <pthread.h>
  10. namespace boost_has_sched_yield{
  11. void f()
  12. {
  13. // this is never called, it just has to compile:
  14. int res = sched_yield();
  15. (void) &res;
  16. }
  17. int test()
  18. {
  19. return 0;
  20. }
  21. }