wait.hpp 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * Copyright 2010 Vicente J. Botet Escriba
  3. * Copyright 2015 Andrey Semashev
  4. * Copyright 2017 James E. King, III
  5. *
  6. * Distributed under the Boost Software License, Version 1.0.
  7. * See http://www.boost.org/LICENSE_1_0.txt
  8. */
  9. #ifndef BOOST_WINAPI_WAIT_HPP_INCLUDED_
  10. #define BOOST_WINAPI_WAIT_HPP_INCLUDED_
  11. #include <boost/winapi/basic_types.hpp>
  12. #include <boost/winapi/wait_constants.hpp>
  13. #include <boost/winapi/detail/header.hpp>
  14. #ifdef BOOST_HAS_PRAGMA_ONCE
  15. #pragma once
  16. #endif
  17. #if !defined( BOOST_USE_WINDOWS_H )
  18. extern "C" {
  19. #if BOOST_WINAPI_PARTITION_APP || BOOST_WINAPI_PARTITION_SYSTEM
  20. BOOST_WINAPI_IMPORT boost::winapi::DWORD_ BOOST_WINAPI_WINAPI_CC
  21. WaitForSingleObjectEx(
  22. boost::winapi::HANDLE_ hHandle,
  23. boost::winapi::DWORD_ dwMilliseconds,
  24. boost::winapi::BOOL_ bAlertable);
  25. #endif
  26. #if BOOST_WINAPI_PARTITION_DESKTOP || BOOST_WINAPI_PARTITION_SYSTEM
  27. #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_NT4
  28. BOOST_WINAPI_IMPORT boost::winapi::DWORD_ BOOST_WINAPI_WINAPI_CC
  29. SignalObjectAndWait(
  30. boost::winapi::HANDLE_ hObjectToSignal,
  31. boost::winapi::HANDLE_ hObjectToWaitOn,
  32. boost::winapi::DWORD_ dwMilliseconds,
  33. boost::winapi::BOOL_ bAlertable);
  34. #endif
  35. #endif
  36. #if BOOST_WINAPI_PARTITION_APP_SYSTEM
  37. BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::DWORD_ BOOST_WINAPI_WINAPI_CC
  38. WaitForSingleObject(
  39. boost::winapi::HANDLE_ hHandle,
  40. boost::winapi::DWORD_ dwMilliseconds);
  41. BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::DWORD_ BOOST_WINAPI_WINAPI_CC
  42. WaitForMultipleObjects(
  43. boost::winapi::DWORD_ nCount,
  44. boost::winapi::HANDLE_ const* lpHandles,
  45. boost::winapi::BOOL_ bWaitAll,
  46. boost::winapi::DWORD_ dwMilliseconds);
  47. BOOST_WINAPI_IMPORT boost::winapi::DWORD_ BOOST_WINAPI_WINAPI_CC
  48. WaitForMultipleObjectsEx(
  49. boost::winapi::DWORD_ nCount,
  50. boost::winapi::HANDLE_ const* lpHandles,
  51. boost::winapi::BOOL_ bWaitAll,
  52. boost::winapi::DWORD_ dwMilliseconds,
  53. boost::winapi::BOOL_ bAlertable);
  54. #endif // BOOST_WINAPI_PARTITION_APP_SYSTEM
  55. } // extern "C"
  56. #endif
  57. namespace boost {
  58. namespace winapi {
  59. #if BOOST_WINAPI_PARTITION_APP || BOOST_WINAPI_PARTITION_SYSTEM
  60. using ::WaitForSingleObjectEx;
  61. #endif
  62. #if BOOST_WINAPI_PARTITION_DESKTOP || BOOST_WINAPI_PARTITION_SYSTEM
  63. #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_NT4
  64. using ::SignalObjectAndWait;
  65. #endif
  66. #endif
  67. #if BOOST_WINAPI_PARTITION_APP_SYSTEM
  68. using ::WaitForMultipleObjects;
  69. using ::WaitForMultipleObjectsEx;
  70. using ::WaitForSingleObject;
  71. #endif
  72. }
  73. }
  74. #include <boost/winapi/detail/footer.hpp>
  75. #endif // BOOST_WINAPI_WAIT_HPP_INCLUDED_