2
0
mirror of https://github.com/boostorg/atomic.git synced 2026-01-19 04:02:09 +00:00

Removed BOOST_ATOMIC_NO_ATOMIC_FLAG_INIT macro definition.

Since the library now requires C++11, BOOST_ATOMIC_FLAG_INIT is always
supported.
This commit is contained in:
Andrey Semashev
2025-06-12 00:54:03 +03:00
parent fc751f1db6
commit 1fa02d93f0
5 changed files with 1 additions and 22 deletions

View File

@@ -571,9 +571,6 @@ the `BOOST_ATOMIC_FLAG_INIT` macro, which is equivalent to `ATOMIC_FLAG_INIT`:
boost::atomic_flag flag = BOOST_ATOMIC_FLAG_INIT; // constant initialization
This macro will only be implemented on a C++11 compiler. When this macro is not available,
the library defines `BOOST_ATOMIC_NO_ATOMIC_FLAG_INIT`.
[endsect]
[section:interface_atomic_object Atomic objects]
@@ -1526,13 +1523,6 @@ which can also be useful. Like the standard ones, the `*_LOCK_FREE` macros below
[`BOOST_ATOMIC_INT128_LOCK_FREE`]
[Indicate whether `atomic<int128_type>` is lock-free.]
]
[
[`BOOST_ATOMIC_NO_ATOMIC_FLAG_INIT`]
[Defined after including `atomic_flag.hpp`, if the implementation
does not support the `BOOST_ATOMIC_FLAG_INIT` macro for static
initialization of `atomic_flag`. This macro is typically defined
for pre-C++11 compilers.]
]
[
[`BOOST_ATOMIC_NO_CLEAR_PADDING`]
[Defined if the implementation does not support operating on types

View File

@@ -15,6 +15,7 @@
* Support for Windows CE is deprecated and will be removed in a future release.
* Added support for timed waiting operations.
* Exposed `thread_pause` operation, which can be used as a backoff measure in spin loops. Added support for PowerPC and improved support for AArch64 in `thread_pause`.
* Removed `BOOST_ATOMIC_NO_ATOMIC_FLAG_INIT` macro definition. Since the library now requires C++11, `BOOST_ATOMIC_FLAG_INIT` is always supported.
[heading Boost 1.87]

View File

@@ -71,11 +71,7 @@ struct is_atomic_ref< boost::ipc_atomic_ref< T > > :
template< typename Flag >
inline void test_flag_api(void)
{
#ifndef BOOST_ATOMIC_NO_ATOMIC_FLAG_INIT
Flag f = BOOST_ATOMIC_FLAG_INIT;
#else
Flag f;
#endif
BOOST_TEST( !f.test() );
BOOST_TEST( !f.test_and_set() );

View File

@@ -677,11 +677,7 @@ inline void test_wait_notify_api(T value1, T value2, T value3, int has_native_wa
inline void test_flag_wait_notify_api()
{
#if BOOST_ATOMIC_FLAG_LOCK_FREE == 2
#ifndef BOOST_ATOMIC_NO_ATOMIC_FLAG_INIT
boost::ipc_atomic_flag f = BOOST_ATOMIC_FLAG_INIT;
#else
boost::ipc_atomic_flag f;
#endif
bool received_value = f.wait(true);
BOOST_TEST(!received_value);

View File

@@ -637,11 +637,7 @@ void test_wait_notify_api(T value1, T value2, T value3, int has_native_wait_noti
inline void test_flag_wait_notify_api()
{
#ifndef BOOST_ATOMIC_NO_ATOMIC_FLAG_INIT
boost::atomic_flag f = BOOST_ATOMIC_FLAG_INIT;
#else
boost::atomic_flag f;
#endif
bool received_value = f.wait(true);
BOOST_TEST(!received_value);