native_handle_pass.cpp 1.2 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/recursive_mutex.hpp>
  14. // class recursive_mutex;
  15. // typedef pthread_recursive_mutex_t* native_handle_type;
  16. // native_handle_type native_handle();
  17. #include <boost/thread/recursive_mutex.hpp>
  18. #include <boost/detail/lightweight_test.hpp>
  19. int main()
  20. {
  21. #if defined BOOST_THREAD_DEFINES_RECURSIVE_MUTEX_NATIVE_HANDLE
  22. boost::recursive_mutex m;
  23. boost::recursive_mutex::native_handle_type h = m.native_handle();
  24. BOOST_TEST(h);
  25. #else
  26. #error "Test not applicable: BOOST_THREAD_DEFINES_RECURSIVE_MUTEX_NATIVE_HANDLE not defined for this platform as not supported"
  27. #endif
  28. return boost::report_errors();
  29. }