Also, refactored futex-related code base to reduce code duplication.
Fixed futex error code handling in the lock pool implementation.
Added a workaround for OpenBSD 7.0 changing the way it returns errors
from the futex calls.
The new header provides a fallback implementation for std::chrono::ceil
on pre-C++17 compilers and specializes posix_clock_traits for
std::chrono::system_clock.
posix_clock_traits will be used in timed waiting operations for integrating
chrono clocks with POSIX clocks. Users may specialize this class template
to improve efficiency of the timed waiting operations, when their clock
types can be mapped onto one of the POSIX clocks.
Also added a has_posix_clock_traits trait to detect if posix_clock_traits
specialization exists for a given clock type.
We are going to use more C++11 features unconditionally, so add more
requirements in the build files. Don't straight require cxx11 in the
Jamfile as this eliminates all versions of MSVC from the builds.
Also remove older compilers that don't support enough of C++11 from CI.
This uses vmactions/solaris-vm project that creates a Solaris virtual
machine and runs the CI job in it.
This CI job is mainly useful for testing fallback POSIX implementation
of waiting/notifying operations.
This mitigates majority of spurious job failures caused by HTTP errors from
Ubuntu APT servers. Presumably, this is caused by DDoS filters triggered by
a multitude of CI jobs started at once.
Some jobs that access Launchpad repositories may still occasionally fail.
Windows SDK headers in MinGW-w64 define _WIN32_WINNT to _WIN32_WINNT_WS03
by default, which prevents Boost.WinAPI from applying its own default.
This disables the WaitOnAddress API that is now required by Boost.Atomic.
Define _WIN32_WINNT to 0x0A00 ourselves on this platform (which is
the highest supported value anyway) to avoid breaking downstream libraries.
Refs https://github.com/boostorg/atomic/issues/73.
This makes WaitOnAddress/WakeByAddressSingle/WakeByAddressAll a mandatory
requirement. Thus, runtime detection of these APIs is now removed.
Also, linking with synchronization lib on Windows is now mandatory. The
library provides WaitOnAddress & co. which are now mandatory.
Boost.Atomic unconditionally writes to `expected` upon returning from
compare_exchange in most backends, and this behavior is documented. This
is different from std::atomic, which only writes to `expected` if
compare_exchange returns false. This may be a significant difference,
if `expected` references data that is supposed to be protected by
the atomic via the memory order constraint.
Added a note in the docs that highlights this difference. Since this
is a documented behavior, and relying on the strict std::atomic-conforming
behavior is probably not a good idea in practice anyway (i.e. such code
would be dubious at best), the implementation is left as is. The generated
code may be slightly more efficient this way, too, since there is one less
branch. We may revisit this later, if there appears a stronger incentive
to be more C++ standard compliant.
Also, explicitly implement 128-bit store operation instead of relying
on exchange implementation. This reduces the amount of branches compiled
since store does not need to handle acquire/consume memory order.
Also, explicitly implement 64-bit store operation instead of relying
on exchange implementation. This reduces the amount of branches compiled
since store does not need to handle acquire/consume memory order.
Fences cannot be instrumented because there is no specific address to pass
to the instrumentation API. Just always use the atomic intrinsic and hope
TSAN is able to figure it out somehow. (Fences are not supported in gcc's
TSAN, as of gcc 13.3.)
gcc 13.1 and clang 16 now generate the ldapr instructions for atomic loads
when ARMv8.3-RCPC or later is enabled. Resorting to inline asm for this
is no longer necessary.
Added more recent gcc and clang versions, reduced usage of external package
repositories. macos-12 image is now removed from GitHub Actions, so removed
the CI job based on it.
* Make the library modular usable.
* Switch to library requirements instead of source. As source puts extra source in install targets.
* Add missing NO_LIB usage requirements.
* Add requires-b2 check to top-level build file.
* Update dependencies.
* Bump B2 require to 5.2
* Update copyright dates.
* Move inter-lib dependencies to a project variable and into the build targets.
* Split b2 dependencies into public and private.
* Be explicit about the kind of public dependencies and make the winapi be conditional on windows target-os.
Since recent OpenBSD versions have removed syscall(2) interface, use
futex(2) wrapper that was also added along with the SYS_futex syscall.
Closes https://github.com/boostorg/atomic/pull/68.