Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:33:58

0001 /*
0002  * Distributed under the Boost Software License, Version 1.0.
0003  * (See accompanying file LICENSE_1_0.txt or copy at
0004  * http://www.boost.org/LICENSE_1_0.txt)
0005  *
0006  * Copyright (c) 2020 Andrey Semashev
0007  */
0008 /*!
0009  * \file   atomic/detail/wait_caps_windows.hpp
0010  *
0011  * This header defines waiting/notifying operations capabilities macros.
0012  */
0013 
0014 #ifndef BOOST_ATOMIC_DETAIL_WAIT_CAPS_WINDOWS_HPP_INCLUDED_
0015 #define BOOST_ATOMIC_DETAIL_WAIT_CAPS_WINDOWS_HPP_INCLUDED_
0016 
0017 #include <boost/winapi/config.hpp>
0018 #include <boost/atomic/detail/config.hpp>
0019 #include <boost/atomic/detail/capabilities.hpp>
0020 
0021 #ifdef BOOST_HAS_PRAGMA_ONCE
0022 #pragma once
0023 #endif
0024 
0025 // MSDN says WaitOnAddress, WakeByAddressSingle and WakeByAddressAll only support notifications between threads of the same process, so no address-free operations.
0026 // https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-waitonaddress
0027 // https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-wakebyaddresssingle
0028 // https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-wakebyaddressall
0029 
0030 #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN8 && (BOOST_WINAPI_PARTITION_APP || BOOST_WINAPI_PARTITION_SYSTEM)
0031 
0032 #define BOOST_ATOMIC_DETAIL_WINDOWS_HAS_WAIT_ON_ADDRESS
0033 
0034 #define BOOST_ATOMIC_HAS_NATIVE_INT8_WAIT_NOTIFY BOOST_ATOMIC_INT8_LOCK_FREE
0035 #define BOOST_ATOMIC_HAS_NATIVE_INT16_WAIT_NOTIFY BOOST_ATOMIC_INT16_LOCK_FREE
0036 #define BOOST_ATOMIC_HAS_NATIVE_INT32_WAIT_NOTIFY BOOST_ATOMIC_INT32_LOCK_FREE
0037 #define BOOST_ATOMIC_HAS_NATIVE_INT64_WAIT_NOTIFY BOOST_ATOMIC_INT64_LOCK_FREE
0038 
0039 #else // BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN8 && (BOOST_WINAPI_PARTITION_APP || BOOST_WINAPI_PARTITION_SYSTEM)
0040 
0041 // Since we'll detect availability of WaitOnAddress etc. at run time, we have to define capability macros to 1 instead of 2
0042 #if BOOST_ATOMIC_INT8_LOCK_FREE > 0
0043 #define BOOST_ATOMIC_HAS_NATIVE_INT8_WAIT_NOTIFY 1
0044 #endif
0045 #if BOOST_ATOMIC_INT16_LOCK_FREE > 0
0046 #define BOOST_ATOMIC_HAS_NATIVE_INT16_WAIT_NOTIFY 1
0047 #endif
0048 #if BOOST_ATOMIC_INT32_LOCK_FREE > 0
0049 #define BOOST_ATOMIC_HAS_NATIVE_INT32_WAIT_NOTIFY 1
0050 #endif
0051 #if BOOST_ATOMIC_INT64_LOCK_FREE > 0
0052 #define BOOST_ATOMIC_HAS_NATIVE_INT64_WAIT_NOTIFY 1
0053 #endif
0054 
0055 #endif // BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN8 && (BOOST_WINAPI_PARTITION_APP || BOOST_WINAPI_PARTITION_SYSTEM)
0056 
0057 #endif // BOOST_ATOMIC_DETAIL_WAIT_CAPS_WINDOWS_HPP_INCLUDED_