Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:02:28

0001 /*
0002  * Copyright 2013 Andrey Semashev
0003  *
0004  * Distributed under the Boost Software License, Version 1.0.
0005  * See http://www.boost.org/LICENSE_1_0.txt
0006  */
0007 
0008 #ifndef BOOST_WINAPI_THREAD_POOL_HPP_INCLUDED_
0009 #define BOOST_WINAPI_THREAD_POOL_HPP_INCLUDED_
0010 
0011 #include <boost/winapi/config.hpp>
0012 
0013 #ifdef BOOST_HAS_PRAGMA_ONCE
0014 #pragma once
0015 #endif
0016 
0017 #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN2K
0018 
0019 #include <boost/winapi/basic_types.hpp>
0020 #include <boost/winapi/detail/header.hpp>
0021 
0022 #if !defined( BOOST_USE_WINDOWS_H )
0023 extern "C" {
0024 #if BOOST_WINAPI_PARTITION_DESKTOP
0025 typedef boost::winapi::VOID_ (BOOST_WINAPI_NTAPI_CC *WAITORTIMERCALLBACKFUNC)
0026     (boost::winapi::PVOID_, boost::winapi::BOOLEAN_);
0027 typedef WAITORTIMERCALLBACKFUNC WAITORTIMERCALLBACK;
0028 
0029 BOOST_WINAPI_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
0030 RegisterWaitForSingleObject(
0031     boost::winapi::PHANDLE_ phNewWaitObject,
0032     boost::winapi::HANDLE_ hObject,
0033     WAITORTIMERCALLBACK Callback,
0034     boost::winapi::PVOID_ Context,
0035     boost::winapi::ULONG_ dwMilliseconds,
0036     boost::winapi::ULONG_ dwFlags);
0037 #endif
0038 } // extern "C"
0039 #endif
0040 
0041 // MinGW is buggy - it is missing these function declarations for Win2000
0042 #if !defined( BOOST_USE_WINDOWS_H ) || (defined(BOOST_WINAPI_IS_MINGW) && BOOST_USE_WINAPI_VERSION < BOOST_WINAPI_VERSION_WINXP)
0043 extern "C" {
0044 #if BOOST_WINAPI_PARTITION_DESKTOP
0045 BOOST_WINAPI_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
0046 UnregisterWait(boost::winapi::HANDLE_ WaitHandle);
0047 #endif
0048 
0049 #if BOOST_WINAPI_PARTITION_DESKTOP || BOOST_WINAPI_PARTITION_SYSTEM
0050 BOOST_WINAPI_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
0051 UnregisterWaitEx(
0052     boost::winapi::HANDLE_ WaitHandle,
0053     boost::winapi::HANDLE_ CompletionEvent);
0054 #endif
0055 } // extern "C"
0056 #endif
0057 
0058 namespace boost {
0059 namespace winapi {
0060 
0061 #if BOOST_WINAPI_PARTITION_DESKTOP
0062 typedef ::WAITORTIMERCALLBACKFUNC WAITORTIMERCALLBACKFUNC_;
0063 typedef ::WAITORTIMERCALLBACK WAITORTIMERCALLBACK_;
0064 
0065 using ::RegisterWaitForSingleObject;
0066 using ::UnregisterWait;
0067 #endif
0068 
0069 #if BOOST_WINAPI_PARTITION_DESKTOP || BOOST_WINAPI_PARTITION_SYSTEM
0070 using ::UnregisterWaitEx;
0071 #endif
0072 #if defined( BOOST_USE_WINDOWS_H )
0073 
0074 BOOST_CONSTEXPR_OR_CONST ULONG_ WT_EXECUTEDEFAULT_ = WT_EXECUTEDEFAULT;
0075 BOOST_CONSTEXPR_OR_CONST ULONG_ WT_EXECUTEINIOTHREAD_ = WT_EXECUTEINIOTHREAD;
0076 #if defined( BOOST_WINAPI_IS_MINGW )
0077 BOOST_CONSTEXPR_OR_CONST ULONG_ WT_EXECUTEINUITHREAD_ = 0x00000002;
0078 #else
0079 BOOST_CONSTEXPR_OR_CONST ULONG_ WT_EXECUTEINUITHREAD_ = WT_EXECUTEINUITHREAD;
0080 #endif
0081 BOOST_CONSTEXPR_OR_CONST ULONG_ WT_EXECUTEINWAITTHREAD_ = WT_EXECUTEINWAITTHREAD;
0082 BOOST_CONSTEXPR_OR_CONST ULONG_ WT_EXECUTEONLYONCE_ = WT_EXECUTEONLYONCE;
0083 BOOST_CONSTEXPR_OR_CONST ULONG_ WT_EXECUTEINTIMERTHREAD_ = WT_EXECUTEINTIMERTHREAD;
0084 BOOST_CONSTEXPR_OR_CONST ULONG_ WT_EXECUTELONGFUNCTION_ = WT_EXECUTELONGFUNCTION;
0085 #if defined( BOOST_WINAPI_IS_MINGW )
0086 BOOST_CONSTEXPR_OR_CONST ULONG_ WT_EXECUTEINPERSISTENTIOTHREAD_ = 0x00000040;
0087 #else
0088 BOOST_CONSTEXPR_OR_CONST ULONG_ WT_EXECUTEINPERSISTENTIOTHREAD_ = WT_EXECUTEINPERSISTENTIOTHREAD;
0089 #endif
0090 BOOST_CONSTEXPR_OR_CONST ULONG_ WT_EXECUTEINPERSISTENTTHREAD_ = WT_EXECUTEINPERSISTENTTHREAD;
0091 BOOST_CONSTEXPR_OR_CONST ULONG_ WT_TRANSFER_IMPERSONATION_ = WT_TRANSFER_IMPERSONATION;
0092 
0093 #else // defined( BOOST_USE_WINDOWS_H )
0094 
0095 BOOST_CONSTEXPR_OR_CONST ULONG_ WT_EXECUTEDEFAULT_ = 0x00000000;
0096 BOOST_CONSTEXPR_OR_CONST ULONG_ WT_EXECUTEINIOTHREAD_ = 0x00000001;
0097 BOOST_CONSTEXPR_OR_CONST ULONG_ WT_EXECUTEINUITHREAD_ = 0x00000002;
0098 BOOST_CONSTEXPR_OR_CONST ULONG_ WT_EXECUTEINWAITTHREAD_ = 0x00000004;
0099 BOOST_CONSTEXPR_OR_CONST ULONG_ WT_EXECUTEONLYONCE_ = 0x00000008;
0100 BOOST_CONSTEXPR_OR_CONST ULONG_ WT_EXECUTEINTIMERTHREAD_ = 0x00000020;
0101 BOOST_CONSTEXPR_OR_CONST ULONG_ WT_EXECUTELONGFUNCTION_ = 0x00000010;
0102 BOOST_CONSTEXPR_OR_CONST ULONG_ WT_EXECUTEINPERSISTENTIOTHREAD_ = 0x00000040;
0103 BOOST_CONSTEXPR_OR_CONST ULONG_ WT_EXECUTEINPERSISTENTTHREAD_ = 0x00000080;
0104 BOOST_CONSTEXPR_OR_CONST ULONG_ WT_TRANSFER_IMPERSONATION_ = 0x00000100;
0105 
0106 #endif // defined( BOOST_USE_WINDOWS_H )
0107 
0108 BOOST_FORCEINLINE BOOST_CONSTEXPR ULONG_ wt_set_max_threadpool_threads(ULONG_ flags, ULONG_ limit) BOOST_NOEXCEPT
0109 {
0110     // Note: We don't use WT_SET_MAX_THREADPOOL_THREADS here because the way it's defined
0111     //       the function no longer meets C++11 constexpr requirements.
0112     return flags | (limit << 16);
0113 }
0114 
0115 BOOST_CONSTEXPR_OR_CONST ULONG_ wt_execute_default = WT_EXECUTEDEFAULT_;
0116 BOOST_CONSTEXPR_OR_CONST ULONG_ wt_execute_in_io_thread = WT_EXECUTEINIOTHREAD_;
0117 BOOST_CONSTEXPR_OR_CONST ULONG_ wt_execute_in_ui_thread = WT_EXECUTEINUITHREAD_;
0118 BOOST_CONSTEXPR_OR_CONST ULONG_ wt_execute_in_wait_thread = WT_EXECUTEINWAITTHREAD_;
0119 BOOST_CONSTEXPR_OR_CONST ULONG_ wt_execute_only_once = WT_EXECUTEONLYONCE_;
0120 BOOST_CONSTEXPR_OR_CONST ULONG_ wt_execute_in_timer_thread = WT_EXECUTEINTIMERTHREAD_;
0121 BOOST_CONSTEXPR_OR_CONST ULONG_ wt_execute_long_function = WT_EXECUTELONGFUNCTION_;
0122 BOOST_CONSTEXPR_OR_CONST ULONG_ wt_execute_in_persistent_io_thread = WT_EXECUTEINPERSISTENTIOTHREAD_;
0123 BOOST_CONSTEXPR_OR_CONST ULONG_ wt_execute_in_persistent_thread = WT_EXECUTEINPERSISTENTTHREAD_;
0124 BOOST_CONSTEXPR_OR_CONST ULONG_ wt_transfer_impersonation = WT_TRANSFER_IMPERSONATION_;
0125 
0126 }
0127 }
0128 
0129 #include <boost/winapi/detail/footer.hpp>
0130 
0131 #endif // BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN2K
0132 #endif // BOOST_WINAPI_THREAD_POOL_HPP_INCLUDED_