native_handle_pass.cpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. //===----------------------------------------------------------------------===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is dual licensed under the MIT and the University of Illinois Open
  6. // Source Licenses. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. // Copyright (C) 2011 Vicente J. Botet Escriba
  10. //
  11. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  12. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  13. // <boost/thread/condition_variable>
  14. // class condition_variable;
  15. // condition_variable(const condition_variable&) = delete;
  16. #include <boost/thread/condition_variable.hpp>
  17. #include <boost/static_assert.hpp>
  18. #include <boost/detail/lightweight_test.hpp>
  19. int main()
  20. {
  21. #if defined BOOST_THREAD_DEFINES_CONDITION_VARIABLE_NATIVE_HANDLE
  22. //BOOST_STATIC_ASSERT((boost::is_same<boost::condition_variable::native_handle_type, pthread_cond_t*>::value));
  23. boost::condition_variable cv;
  24. boost::condition_variable::native_handle_type h = cv.native_handle();
  25. BOOST_TEST(h != 0);
  26. #else
  27. #error "Test not applicable: BOOST_THREAD_DEFINES_CONDITION_VARIABLE_NATIVE_HANDLE not defined for this platform as not supported"
  28. #endif
  29. return boost::report_errors();
  30. }