1 // wait.hpp --------------------------------------------------------------//
3 // Copyright 2010 Vicente J. Botet Escriba
4 // Copyright 2015 Andrey Semashev
6 // Distributed under the Boost Software License, Version 1.0.
7 // See http://www.boost.org/LICENSE_1_0.txt
10 #ifndef BOOST_DETAIL_WINAPI_WAIT_HPP
11 #define BOOST_DETAIL_WINAPI_WAIT_HPP
13 #include <boost/detail/winapi/basic_types.hpp>
15 #ifdef BOOST_HAS_PRAGMA_ONCE
19 #if !defined( BOOST_USE_WINDOWS_H )
21 BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
23 boost::detail::winapi::HANDLE_ hHandle,
24 boost::detail::winapi::DWORD_ dwMilliseconds);
26 BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
27 WaitForMultipleObjects(
28 boost::detail::winapi::DWORD_ nCount,
29 boost::detail::winapi::HANDLE_ const* lpHandles,
30 boost::detail::winapi::BOOL_ bWaitAll,
31 boost::detail::winapi::DWORD_ dwMilliseconds);
33 #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_NT4
34 BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
36 boost::detail::winapi::HANDLE_ hObjectToSignal,
37 boost::detail::winapi::HANDLE_ hObjectToWaitOn,
38 boost::detail::winapi::DWORD_ dwMilliseconds,
39 boost::detail::winapi::BOOL_ bAlertable);
48 using ::WaitForMultipleObjects;
49 using ::WaitForSingleObject;
50 #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_NT4
51 using ::SignalObjectAndWait;
54 #if defined( BOOST_USE_WINDOWS_H )
56 const DWORD_ INFINITE_ = INFINITE;
57 const DWORD_ WAIT_ABANDONED_ = WAIT_ABANDONED;
58 const DWORD_ WAIT_OBJECT_0_ = WAIT_OBJECT_0;
59 const DWORD_ WAIT_TIMEOUT_ = WAIT_TIMEOUT;
60 const DWORD_ WAIT_FAILED_ = WAIT_FAILED;
62 #else // defined( BOOST_USE_WINDOWS_H )
64 const DWORD_ INFINITE_ = (DWORD_)0xFFFFFFFF;
65 const DWORD_ WAIT_ABANDONED_ = 0x00000080L;
66 const DWORD_ WAIT_OBJECT_0_ = 0x00000000L;
67 const DWORD_ WAIT_TIMEOUT_ = 0x00000102L;
68 const DWORD_ WAIT_FAILED_ = (DWORD_)0xFFFFFFFF;
70 #endif // defined( BOOST_USE_WINDOWS_H )
72 const DWORD_ infinite = INFINITE_;
73 const DWORD_ wait_abandoned = WAIT_ABANDONED_;
74 const DWORD_ wait_object_0 = WAIT_OBJECT_0_;
75 const DWORD_ wait_timeout = WAIT_TIMEOUT_;
76 const DWORD_ wait_failed = WAIT_FAILED_;
78 const DWORD_ max_non_infinite_wait = (DWORD_)0xFFFFFFFE;
84 #endif // BOOST_DETAIL_WINAPI_WAIT_HPP