boost_has_winthreads.ipp 685 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_WINTHREADS
  7. // TITLE: MS Windows threads
  8. // DESCRIPTION: The platform supports MS Windows style threads.
  9. #include <windows.h>
  10. namespace boost_has_winthreads{
  11. int test()
  12. {
  13. HANDLE h = CreateMutex(0, 0, 0);
  14. if(h != NULL)
  15. {
  16. WaitForSingleObject(h, INFINITE);
  17. ReleaseMutex(h);
  18. CloseHandle(h);
  19. }
  20. return 0;
  21. }
  22. }