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
e75e25bcd0 Lower C++17 template deduction guides version check.
Checking against version 201606 allows to enable template deduction
guides starting with gcc 7 and clang 5.
2022-01-20 22:50:15 +03:00
Andrey Semashev
bf08155d16 Fix compilation for UWP.
UWP does not support APIs related to dynamic symbol binding and dlls.
Disable runtime detection of WaitOnAddress & co. for that target. These
APIs should be enabled at compile time on Windows 8.

Fixes https://github.com/boostorg/atomic/issues/54.
2021-12-15 02:06:11 +03:00
Andrey Semashev
e08957fb1c Changed docs/Jamfile to generate docs in the library subdirectory.
Supposedly, Boost.Atomic docs were generated in the root doc directory
because they were built as part of the boostdoc target. The updated Jamfile
uses boostrelease target instead, which will hopefully move the docs
under libs/atomic/doc.

Also removed unused css and images copying - we have neither in the docs.
The logo image is not used in the docs, only in README.md.
2021-12-08 19:19:22 +03:00
Andrey Semashev
7110e5b739 Silenced bjam warning about unescaped character. boost-1.78.0 2021-11-19 17:57:13 +03:00
Andrey Semashev
2069feeb79 Updated check for apt-add-repository capabilities.
In Ubuntu 20.04 there appeared an updated version of the
software-properties-common package in focal-updates, which ships a newer
apt-add-repository version that doesn't support -P/-S/-U command line arguments.

Since we cannot rely on package version checks to determine apt-add-repository
capabilities, we have to parse its --help output instead.

Also, made source list processing more protected against spaces.
2021-11-15 22:15:08 +03:00
Andrey Semashev
ead065fc47 Added a release note for VS2015 workaround. 2021-11-15 13:28:12 +03:00
Andrey Semashev
71e9ed3417 Only enable _mm_set1_epi64x on VS2015 Update 3 and later.
Because apparently it was missing before update 3.

Closes https://github.com/boostorg/atomic/issues/52.
2021-11-15 12:51:05 +03:00
Andrey Semashev
4ae987a617 Added a release note for the added workaround for AIX. boost-1.78.0.beta1 2021-10-28 18:15:08 +03:00
Andrey Semashev
64f0021924 Extracted common macro definitions for gcc PowerPC asm to a separate header. 2021-10-28 18:07:54 +03:00
Clément Chigot
77bca7a9c6 details: adapt headers to AIX assembler
AIX assembler doesn't allow "bne- 1b" or "bne- 1f" symtax to jump to a
given label. It must be replaced by "bne- $N", N being the memory
offset between the current instruction and the targeted label.
2021-10-28 17:38:22 +03:00
Andrey Semashev
f4037199b7 Removed names of unused parameters to silence warnings. 2021-10-27 12:04:07 +03:00
Andrey Semashev
e955004915 Mention bit_cast as a requirement for constexpr atomic ctors. 2021-10-12 23:35:55 +03:00
Andrey Semashev
1d4e279d41 Updated the note about clearing padding in unions. 2021-10-12 23:19:14 +03:00
Andrey Semashev
8a7aaa543d Make atomic default ctors value initialize the contained object.
This is in line with the C++20 change that requires the default constructor
of std::atomic to value initialize the atomic object.

Also, use is_nothrow_default_constructible to properly deduce noexceptness
of the default constructors of atomics.
2021-10-12 20:36:11 +03:00
Andrey Semashev
2211fee1d4 Added bitwise_cast implementation based on bit_cast intrinsics.
This allows to mark bitwise_cast constexpr when the conditions to use
bit_cast are met:

 - both source and target types have the same size, and
 - the source type has no padding bits.

The latter is checked using has_unique_object_representations trait, which
we also implement using intrinsics when not available in the standard
library.

This allows atomic constructors to become constexpr for structs and floating
point types with no padding and whose size matches the atomic storage size.
2021-10-12 18:55:13 +03:00
Andrey Semashev
746ea2649b Added support for types with padding. Made atomic ctors for enums constexpr.
Use __builtin_clear_padding and __builtin_zero_non_value_bits that were
introduced in gcc 11 and MSVC 19.27 to clear the padding bits in atomic
types. The intrinsics are used in bitwise_cast and atomic reference
constructors.

Also, separated atomic impl specializations for enums to allow using
static_cast to convert values to storage. This in turn allows to
relax compiler requirements to mark atomic constructors constexpr.

Updated docs and added tests for structs with padding and constexpr
atomic constructors.
2021-10-11 18:05:06 +03:00
Andrey Semashev
428b326f4e Work around clang-win failures in AppVeyor.
Switch to VS2019 image in attempt to work around the "unable to load
mspdbcore.dll (error code: 126)" errors on compilation for 32-bit x86.

Added calling an environment setup script from VS2019 to work around
missing msvcrt(d).lib errors caused by Boost.Build issue:

https://github.com/bfgroup/b2/issues/98

Also disabled logging of setting up header symlinks.
2021-10-10 04:17:25 +03:00
Andrey Semashev
805e309a29 Fixed discrepancy between always_has_native_wait_notify and caps macros.
When targeting Windows 8, the always_has_native_wait_notify static constant
would be set to false even though the native implementation of waiting
and notifying operations through WaitOnAddress would always be used.

To fix this, moved direct WaitOnAddress & co. usage to public header. This
also requires users to link with synchronization.lib, which is done
automatically on compilers that support auto-linking.

The compiled library still implements runtime detection of WaitOnAddress,
even when building for Windows 8 and later. This allows user's code to
be later compiled for Windows 7 and older and still work. This code is
not used when user's code targets Windows 8 or later.

As part of this refactoring, renamed has_synchronization test and
related CMake variable to better communicate that we're testing for
a library.
2021-10-09 23:40:42 +03:00
Andrey Semashev
c02e692267 Run msvc-14.2 AppVeyor job with _WIN32_WINNT=0x0602 to test native wait/notify constants. 2021-10-09 21:30:53 +03:00
Andrey Semashev
0d94ec81f3 Added MinGW-w64 gcc 8.1 AppVeyor CI job. 2021-10-09 21:28:46 +03:00
Andrey Semashev
ef4dedb031 Added tests for HAS_NATIVE_WAIT_NOTIFY macros and static constants. 2021-10-09 21:22:20 +03:00
Andrey Semashev
d45947a406 [skip ci] Added an advice to avoid resizing memory with IPC ops running. 2021-10-06 14:27:06 +03:00
Andrey Semashev
ffdccceeb1 Added changelog document. 2021-09-26 23:07:49 +03:00
Andrey Semashev
cbf5ae1ad2 Allocate IPC atomic objects in dynamic memory instead of the stack.
This works around spurious test failures on Mac OS as the notifying operation
sometimes fails with ENOENT. Presumably, the OS sometimes invalidates the
internal identification of the stack memory region, which makes __ulock_wake
fail to find the ulock object that other threads are blocked on.

By using dynamic memory we (hopefully) are using a location in a normal mapped
memory region that should not be mangled by the OS. Ideally, we would use
process-shared memory for this test, but that makes it more difficult to make
it portable and runnable in parallel. Dynamic local memory should do for now.
2021-09-26 19:54:01 +03:00
Andrey Semashev
93b9f3d72d Added wait/notify operations backend for Darwin ulock API.
The backend supports 32 and 64-bit atomics, process-local and inter-process
operations.

https://shift.click/blog/futex-like-apis/#darwin-macos-ios-tvos-watchos-and-more
https://github.com/apple/darwin-xnu/blob/master/bsd/sys/ulock.h
https://github.com/apple/darwin-xnu/blob/master/bsd/kern/sys_ulock.c
2021-09-26 19:54:01 +03:00
Andrey Semashev
265a92a2c3 Added Mac OS 11 test job. 2021-09-26 19:53:54 +03:00
Andrey Semashev
b31b6121b4 [skip ci] Corrected a typo in the comment. 2021-09-17 20:14:37 +03:00
Andrey Semashev
ee3257378b Added a timeout for GHA CI. 2021-09-15 20:47:27 +03:00
Andrey Semashev
11c45c654b Removed unused reference to extra_tests. 2021-09-12 19:23:00 +03:00
Andrey Semashev
6f3e4271d3 Removed installation of unnecessary packages in GHA CI. 2021-09-12 18:26:23 +03:00
Andrey Semashev
571f9096dd Don't build b2 and create headers tree for CMake tests. 2021-09-12 18:04:19 +03:00
Andrey Semashev
080b5c042a Extended std::alignment_of workaround to clang 8.
As shown by GitHub Actions CI, stock clang 8 from Ubuntu 18.04
also reports an incorrect alignment of 64-bit types on 32-bit targets.
Liiks like the bug was fixed in some patch version of the 8.x branch,
but it's difficult to know which one, so just always use boost::alignment_of
up to clang 9.
2021-09-12 16:00:45 +03:00
Andrey Semashev
5f4847de74 Added GitHub Actions CI config. 2021-09-12 16:00:35 +03:00
Andrey Semashev
76027b1126 Removed Travis CI config.
Since Travis CI no longer runs jobs for open source projects, we are
switching to GitHub Actions instead.
2021-09-11 23:48:05 +03:00
Andrey Semashev
d29f6452e2 Switch CI links from Travis CI to GitHub Actions. 2021-09-11 23:48:05 +03:00
Andrey Semashev
762dc8fe0f Added support for platforms that only define SYS_futex_time64. 2021-08-25 00:01:38 +03:00
Andrey Semashev
f83d9ef1fe Added futex PRIVATE constant definition for Android. 2021-08-24 23:47:04 +03:00
Andrey Semashev
a548b3c15c Added template deduction guides and factory functions for atomic refs. boost-1.77.0.beta1 boost-1.77.0 2021-06-16 02:22:40 +03:00
Andrey Semashev
40f4c95733 Generate list of Boost library includes for CMake configure checks.
In order to avoid hardcoding library dependencies recursively for the
configure checks performed in CMake build scripts, we generate the list
of all include directories. If there is a unified Boost include tree,
we can use that and avoid filesystem scanning.
2021-06-14 22:57:25 +03:00
Andrey Semashev
54b39d3680 Changed Focal CI jobs to Bionic.
There are package installation errors on Focal.
2021-05-20 12:40:23 +03:00
Andrey Semashev
44a7ed2e97 Updated Travis CI config.
- Switched gcc 10 to Focal since it is now available in the main
  repository and the compiler version is 10.2 rather than a pre-release.
- Added gcc 11 job.
- Added clang 11 and 12 jobs.
2021-05-20 03:14:39 +03:00
Andrey Semashev
190cd8d10e Added setup of threading compiler flags to CMakeLists.txt.
Since Boost.Atomic may require linking with pthreads, set up
multithreading compiler flags and add a formal dependency on
the threading library in CMakeLists.txt.
2021-05-20 02:59:05 +03:00
Andrey Semashev
08bd4e2033 Merge pull request #49 from juliekoubova/julie-fix-0
Fix dependent name lookup in core_arch_ops_msvc_arm.hpp
boost-1.76.0
2021-04-01 19:48:08 +03:00
Julie Koubová
9462d89c8a Update core_arch_ops_msvc_arm.hpp
Fix the dependent name lookup
2021-04-01 17:45:48 +02:00
Andrey Semashev
e9374cb8db Disabled gcc and clang warnings caused by Boost.Preprocessor.
Boost.Preprocessor uses variadic macros and empty macro arguments
even in C++03 mode, which makes gcc and clang emit lots of warnings.
boost-1.76.0.beta1
2021-02-01 01:29:43 +03:00
Andrey Semashev
b71b7a3d7b Revert "Added arm64, ppc64le and s390x test jobs to Travis CI."
This reverts commit dbb5c7cf7c.

The tests fail in Travis CI because the compiler process gets killed
for some reason.
2021-02-01 00:48:50 +03:00
Andrey Semashev
dbb5c7cf7c Added arm64, ppc64le and s390x test jobs to Travis CI. 2021-01-23 19:51:17 +03:00
Andrey Semashev
a7e01a7160 Merge pull request #44 from eldiener/develop
[skip ci] Add "cxxstd" json field
2021-01-19 12:36:34 +03:00
Edward Diener
14aa7a92e1 [skip ci] Add "cxxstd" json field. The "cxxstd" json field is being added to each Boost library's meta json information for libraries in order to specify the minumum C++ standard compilation level. The value of this field matches one of the values for 'cxxstd' in Boost.Build. The purpose of doing this is to provide information for the Boost website documentation for each library which will specify the minimum C++ standard compilation that an end-user must employ in order to use the particular library. This will aid end-users who want to know if they can successfully use a Boost library based on their C++ compiler's compilation level, without having to search the library's documentation to find this out. 2021-01-18 21:15:06 -05:00
Andrey Semashev
ea5911a413 Added tests for arithmetic and bitwise ops with immediate constants.
This test verifies arithmetic and bitwise (logic) operations with
immediate constant arguments, which may affect instruction choice
in the operations. In particular, the test verifies that bug
https://github.com/boostorg/atomic/issues/41 is fixed.
boost-1.75.0
2020-11-20 13:58:16 +03:00