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

700 Commits

Author SHA1 Message Date
Andrey Semashev
b9fbe99f28 Added timed waiting operations to Mac OS __ulock backend. 2025-06-08 04:37:51 +03:00
Andrey Semashev
c3478c0f7b Added timed waiting operations to FreeBSD _umtx_op backend.
Also added support for *_PRIVATE operations for int-sized atomics.
2025-06-08 04:37:51 +03:00
Andrey Semashev
cc2a6c7937 Added timed waiting operations to DragonFly BSD umtx backend. 2025-06-08 04:37:51 +03:00
Andrey Semashev
7d4bec5470 Added timed waiting operations to the futex-based backend.
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.
2025-06-08 04:37:51 +03:00
Andrey Semashev
012ebef567 Added chrono utilities.
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.
2025-06-08 04:37:51 +03:00
Andrey Semashev
ac87d0b8aa Added forward-declaration of posix_clock_traits.
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.
2025-06-08 04:37:51 +03:00
Andrey Semashev
d374414b41 Added wait_result struct.
The structure will be used for returning the result of timed waiting
operations.
2025-06-08 04:37:51 +03:00
Andrey Semashev
bafa2665aa Require more C++11 support from the compiler.
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.
2025-06-08 04:35:46 +03:00
Andrey Semashev
c30f8843c8 Added ISO C++26 testing on gcc 14 and clang 18 and 19. 2025-06-02 20:11:36 +03:00
Andrey Semashev
8d450c716d Added GitHub Actions CI on Solaris VM.
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.
2025-06-02 20:05:07 +03:00
Andrey Semashev
0a93af8c9d Added GitHub Actions CI on DragonFlyBSD VM.
This uses vmactions/dragonflybsd-vm project that creates a DragonFlyBSD
virtual machine and runs the CI job in it.
2025-06-02 19:54:36 +03:00
Andrey Semashev
9cad48a07f Added GitHub Actions CI on NetBSD VM.
This uses vmactions/netbsd-vm project that creates a NetBSD virtual
machine and runs the CI job in it.
2025-06-02 19:54:36 +03:00
Andrey Semashev
3a799c56a7 Added GitHub Actions CI on OpenBSD VM.
This uses vmactions/openbsd-vm project that creates an OpenBSD virtual
machine and runs the CI job in it.
2025-06-02 19:54:36 +03:00
Andrey Semashev
fb43fd1a35 Added GitHub Actions CI on FreeBSD VM.
This uses vmactions/freebsd-vm project that creates a FreeBSD virtual
machine and runs the CI job in it.
2025-06-02 19:54:36 +03:00
Andrey Semashev
a1fede9103 Use Azure APT mirrors in containers.
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.
2025-06-02 19:53:11 +03:00
Andrey Semashev
1f51e2b9f7 Corrected changelog. 2025-05-31 20:16:34 +03:00
Andrey Semashev
a8a43a8b6d Remove _WIN32_WINNT defines in CI configs.
This is to verify that Boost.Atomic and tests build on MinGW-w64
with default settings despute the too-low default value of _WIN32_WINNT.
2025-05-31 02:09:03 +03:00
Andrey Semashev
9ee34b2199 Define _WIN32_WINNT=0x0A00 on MinGW-w64.
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.
2025-05-31 02:04:34 +03:00
Andrey Semashev
17ad17242b Fixed a typo. 2025-05-30 14:41:24 +03:00
Andrey Semashev
140bb01b17 Added a note for MinGW-w64 users regarding Windows 10. 2025-05-30 13:59:15 +03:00
Andrey Semashev
be679c1894 Removed semaphore-based lock pool implementation on Windows.
We can now unconditionally use SRW locks and condition variables.
2025-05-29 18:06:15 +03:00
Andrey Semashev
411f6f65ab Removed support for Windows versions prior to Windows 10.
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.
2025-05-29 18:06:10 +03:00
Andrey Semashev
acf75a4d91 Added a memory clobber to the encoded spelling of RISC-V pause.
Pause is supposed to be a compiler barrier, so that any memory accesses
that are written after the pause are not reordered before it.
2025-05-29 04:29:24 +03:00
Andrey Semashev
1935a34fa6 Corrected changelog. 2025-05-25 18:33:08 +03:00
Andrey Semashev
58b713112b Don't set instruction-set on Mac OS CI jobs.
The CI jobs are running on ARM CPUs, so setting instruction-set=sandy-bridge
doesn't make sense, even if currently harmless.
2025-05-23 12:09:29 +03:00
Andrey Semashev
ab650ab37f Added a note about difference in behavior with C++11 in compare_exchange.
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.
2025-05-23 11:56:29 +03:00
Andrey Semashev
e288a8c7b6 Added a changelog entry for TSAN instrumentation. 2025-05-23 11:56:29 +03:00
Andrey Semashev
a80b571744 Added TSAN instrumentation for ppc ops. 2025-05-23 11:56:29 +03:00
Andrey Semashev
113cf38606 Added TSAN instrumentation for aarch64 ops.
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.
2025-05-23 11:56:21 +03:00
Andrey Semashev
b770e02760 Added TSAN instrumentation for aarch32 ops.
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.
2025-05-23 03:17:45 +03:00
Andrey Semashev
8531366d13 Added TSAN instrumentation for x86 ops. 2025-05-23 03:14:47 +03:00
Andrey Semashev
dffdab58e8 Use atomic intrinsic for fences instead of asm blocks when TSAN is enabled.
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.)
2025-02-23 00:30:19 +03:00
Andrey Semashev
5dec2143db Added TSAN detection and instrumentation macros. 2025-02-23 00:30:19 +03:00
Andrey Semashev
5e0ce516fb Moved backoff_dummy to the stacks.
This avoids TSAN warnings triggered by concurrent writes to the global
variable, even though there is no race (as noone reads the variable).
2025-02-23 00:30:19 +03:00
Andrey Semashev
de94875920 Suppress TSAN for intentionally racy functions in tests. 2025-02-23 00:30:19 +03:00
Andrey Semashev
fb96eeec40 Added TSAN jobs to GitHub Actions CI. 2025-02-23 00:30:12 +03:00
Andrey Semashev
199906f4e1 Use atomic intrinsics for loads on ARMv8.3-RCPC with recent gcc and clang.
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.
boost-1.88.0.beta1 boost-1.88.0
2025-02-22 18:03:43 +03:00
Andrey Semashev
037f686d36 Added more compilers to GitHub Actions CI, removed macos-12 job.
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.
2024-12-15 23:28:59 +03:00
Andrey Semashev
5e2e016668 Fixed pointer arithmetics in wait state initialization on reallocation.
Fixes https://github.com/boostorg/atomic/issues/72.
boost-1.87.0
2024-11-21 20:06:41 +03:00
Andrey Semashev
b202228311 Added support for running tests in CMake.
Related to https://github.com/boostorg/atomic/issues/71.
boost-1.87.0.beta1
2024-10-19 17:29:55 +03:00
Andrey Semashev
d5914e357f Work around MSVC warnings in test code. 2024-10-19 16:06:48 +03:00
René Ferdinand Rivera Morell
0ed0a5db0c Add support for modular build structure. (#69)
* 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.
2024-10-10 18:31:25 +03:00
Andrey Semashev
54bbc34960 Merge pull request #70 from Flamefire/getprocaddr
Avoid -Wcast-function-type in get_proc_addr
2024-08-26 15:23:51 +03:00
Alexander Grund
f7c51b3012 Avoid -Wcast-function-type in get_proc_addr 2024-08-26 13:03:15 +02:00
Andrey Semashev
c030fbfd29 Moved Boost.Predef to public dependencies in CMakeLists.txt. 2024-08-19 01:52:36 +03:00
Andrey Semashev
fbdb5f44d4 Replaced macos-11 GHA image with 12, 13 and 14 since 11 is being removed. boost-1.86.0.beta1 boost-1.86.0 2024-05-21 01:14:22 +03:00
Andrey Semashev
6ee31382b2 Use futex function wrapper on OpenBSD.
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.
2024-05-19 03:23:49 +03:00
Andrey Semashev
5bbcce0f6e Reduced CI job timeouts. boost-1.85.0.beta1 boost-1.85.0 2024-02-06 00:39:32 +03:00
Andrey Semashev
6594779edc Added gcc-13 CI job. 2024-02-06 00:36:58 +03:00
Andrey Semashev
d875b255fb Replaced actions/checkout usage with manual download commands.
This fixes the deprecation warnings for actions/checkout@v3. actions/checkout@v4
is not functional because of the upstream bug:

https://github.com/actions/checkout/issues/1590
2024-02-05 18:34:02 +03:00