]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | // wait.hpp --------------------------------------------------------------// |
2 | ||
3 | // Copyright 2010 Vicente J. Botet Escriba | |
4 | // Copyright 2015 Andrey Semashev | |
5 | ||
6 | // Distributed under the Boost Software License, Version 1.0. | |
7 | // See http://www.boost.org/LICENSE_1_0.txt | |
8 | ||
9 | ||
10 | #ifndef BOOST_DETAIL_WINAPI_WAIT_HPP | |
11 | #define BOOST_DETAIL_WINAPI_WAIT_HPP | |
12 | ||
13 | #include <boost/detail/winapi/basic_types.hpp> | |
14 | ||
15 | #ifdef BOOST_HAS_PRAGMA_ONCE | |
16 | #pragma once | |
17 | #endif | |
18 | ||
19 | #if !defined( BOOST_USE_WINDOWS_H ) | |
20 | extern "C" { | |
21 | BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI | |
22 | WaitForSingleObject( | |
23 | boost::detail::winapi::HANDLE_ hHandle, | |
24 | boost::detail::winapi::DWORD_ dwMilliseconds); | |
25 | ||
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); | |
32 | ||
33 | #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_NT4 | |
34 | BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI | |
35 | SignalObjectAndWait( | |
36 | boost::detail::winapi::HANDLE_ hObjectToSignal, | |
37 | boost::detail::winapi::HANDLE_ hObjectToWaitOn, | |
38 | boost::detail::winapi::DWORD_ dwMilliseconds, | |
39 | boost::detail::winapi::BOOL_ bAlertable); | |
40 | #endif | |
41 | } | |
42 | #endif | |
43 | ||
44 | namespace boost { | |
45 | namespace detail { | |
46 | namespace winapi { | |
47 | ||
48 | using ::WaitForMultipleObjects; | |
49 | using ::WaitForSingleObject; | |
50 | #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_NT4 | |
51 | using ::SignalObjectAndWait; | |
52 | #endif | |
53 | ||
54 | #if defined( BOOST_USE_WINDOWS_H ) | |
55 | ||
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; | |
61 | ||
62 | #else // defined( BOOST_USE_WINDOWS_H ) | |
63 | ||
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; | |
69 | ||
70 | #endif // defined( BOOST_USE_WINDOWS_H ) | |
71 | ||
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_; | |
77 | ||
78 | const DWORD_ max_non_infinite_wait = (DWORD_)0xFFFFFFFE; | |
79 | ||
80 | } | |
81 | } | |
82 | } | |
83 | ||
84 | #endif // BOOST_DETAIL_WINAPI_WAIT_HPP |