Skip to content

Commit 9ddedf0

Browse files
authored
[libc++] Deprecate the C++20 synchronization library before C++20 (#86410)
When we initially implemented the C++20 synchronization library, we reluctantly accepted for the implementation to be backported to C++03 upon request from the person who provided the patch. This was when we were only starting to have experience with the issues this can create, so we flinched. Nowadays, we have a much stricter stance about not backporting features to previous standards. We have recently started fixing several bugs (and near bugs) in our implementation of the synchronization library. A recurring theme during these reviews has been how difficult to understand the current code is, and upon inspection it becomes clear that being able to use a few recent C++ features (in particular lambdas) would help a great deal. The code would still be pretty intricate, but it would be a lot easier to reason about the flow of callbacks through things like __thread_poll_with_backoff. As a result, this patch deprecates support for the synchronization library before C++20. In the next release, we can remove that support entirely.
1 parent 22629bb commit 9ddedf0

30 files changed

+117
-26
lines changed

libcxx/.clang-format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ AttributeMacros: [
2424
'_LIBCPP_CONSTEXPR_SINCE_CXX23',
2525
'_LIBCPP_CONSTEXPR',
2626
'_LIBCPP_CONSTINIT',
27+
'_LIBCPP_DEPRECATED_ATOMIC_SYNC',
2728
'_LIBCPP_DEPRECATED_IN_CXX11',
2829
'_LIBCPP_DEPRECATED_IN_CXX14',
2930
'_LIBCPP_DEPRECATED_IN_CXX17',

libcxx/docs/ReleaseNotes/19.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ Improvements and New Features
7575
Deprecations and Removals
7676
-------------------------
7777

78+
- The C++20 synchronization library (``<barrier>``, ``<latch>``, ``atomic::wait``, etc.) has been deprecated
79+
in language modes prior to C++20. If you are using these features prior to C++20, please update to ``-std=c++20``.
80+
In LLVM 20, the C++20 synchronization library will be removed entirely in language modes prior to C++20.
81+
7882
- TODO: The ``LIBCXX_ENABLE_ASSERTIONS`` CMake variable that was used to enable the safe mode has been deprecated and setting
7983
it triggers an error; use the ``LIBCXX_HARDENING_MODE`` CMake variable with the value ``extensive`` instead. Similarly,
8084
the ``_LIBCPP_ENABLE_ASSERTIONS`` macro has been deprecated (setting it to ``1`` still enables the extensive mode in

libcxx/include/__atomic/atomic.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -462,22 +462,26 @@ atomic_wait_explicit(const atomic<_Tp>* __o, typename atomic<_Tp>::value_type __
462462
// atomic_notify_one
463463

464464
template <class _Tp>
465-
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void atomic_notify_one(volatile atomic<_Tp>* __o) _NOEXCEPT {
465+
_LIBCPP_DEPRECATED_ATOMIC_SYNC _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void
466+
atomic_notify_one(volatile atomic<_Tp>* __o) _NOEXCEPT {
466467
__o->notify_one();
467468
}
468469
template <class _Tp>
469-
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void atomic_notify_one(atomic<_Tp>* __o) _NOEXCEPT {
470+
_LIBCPP_DEPRECATED_ATOMIC_SYNC _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void
471+
atomic_notify_one(atomic<_Tp>* __o) _NOEXCEPT {
470472
__o->notify_one();
471473
}
472474

473475
// atomic_notify_all
474476

475477
template <class _Tp>
476-
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void atomic_notify_all(volatile atomic<_Tp>* __o) _NOEXCEPT {
478+
_LIBCPP_DEPRECATED_ATOMIC_SYNC _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void
479+
atomic_notify_all(volatile atomic<_Tp>* __o) _NOEXCEPT {
477480
__o->notify_all();
478481
}
479482
template <class _Tp>
480-
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void atomic_notify_all(atomic<_Tp>* __o) _NOEXCEPT {
483+
_LIBCPP_DEPRECATED_ATOMIC_SYNC _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void
484+
atomic_notify_all(atomic<_Tp>* __o) _NOEXCEPT {
481485
__o->notify_all();
482486
}
483487

libcxx/include/__atomic/atomic_flag.h

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,22 +49,26 @@ struct atomic_flag {
4949
__cxx_atomic_store(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(false), __m);
5050
}
5151

52-
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void wait(bool __v, memory_order __m = memory_order_seq_cst) const
53-
volatile _NOEXCEPT {
52+
_LIBCPP_DEPRECATED_ATOMIC_SYNC _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void
53+
wait(bool __v, memory_order __m = memory_order_seq_cst) const volatile _NOEXCEPT {
5454
std::__atomic_wait(*this, _LIBCPP_ATOMIC_FLAG_TYPE(__v), __m);
5555
}
56-
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void
56+
_LIBCPP_DEPRECATED_ATOMIC_SYNC _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void
5757
wait(bool __v, memory_order __m = memory_order_seq_cst) const _NOEXCEPT {
5858
std::__atomic_wait(*this, _LIBCPP_ATOMIC_FLAG_TYPE(__v), __m);
5959
}
60-
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void notify_one() volatile _NOEXCEPT {
60+
_LIBCPP_DEPRECATED_ATOMIC_SYNC _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void notify_one() volatile _NOEXCEPT {
61+
std::__atomic_notify_one(*this);
62+
}
63+
_LIBCPP_DEPRECATED_ATOMIC_SYNC _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void notify_one() _NOEXCEPT {
6164
std::__atomic_notify_one(*this);
6265
}
63-
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void notify_one() _NOEXCEPT { std::__atomic_notify_one(*this); }
6466
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void notify_all() volatile _NOEXCEPT {
6567
std::__atomic_notify_all(*this);
6668
}
67-
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void notify_all() _NOEXCEPT { std::__atomic_notify_all(*this); }
69+
_LIBCPP_DEPRECATED_ATOMIC_SYNC _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void notify_all() _NOEXCEPT {
70+
std::__atomic_notify_all(*this);
71+
}
6872

6973
#if _LIBCPP_STD_VER >= 20
7074
_LIBCPP_HIDE_FROM_ABI constexpr atomic_flag() _NOEXCEPT : __a_(false) {}
@@ -141,41 +145,43 @@ inline _LIBCPP_HIDE_FROM_ABI void atomic_flag_clear_explicit(atomic_flag* __o, m
141145
__o->clear(__m);
142146
}
143147

144-
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void
148+
inline _LIBCPP_DEPRECATED_ATOMIC_SYNC _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void
145149
atomic_flag_wait(const volatile atomic_flag* __o, bool __v) _NOEXCEPT {
146150
__o->wait(__v);
147151
}
148152

149-
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void
153+
inline _LIBCPP_DEPRECATED_ATOMIC_SYNC _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void
150154
atomic_flag_wait(const atomic_flag* __o, bool __v) _NOEXCEPT {
151155
__o->wait(__v);
152156
}
153157

154-
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void
158+
inline _LIBCPP_DEPRECATED_ATOMIC_SYNC _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void
155159
atomic_flag_wait_explicit(const volatile atomic_flag* __o, bool __v, memory_order __m) _NOEXCEPT {
156160
__o->wait(__v, __m);
157161
}
158162

159-
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void
163+
inline _LIBCPP_DEPRECATED_ATOMIC_SYNC _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void
160164
atomic_flag_wait_explicit(const atomic_flag* __o, bool __v, memory_order __m) _NOEXCEPT {
161165
__o->wait(__v, __m);
162166
}
163167

164-
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void
168+
inline _LIBCPP_DEPRECATED_ATOMIC_SYNC _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void
165169
atomic_flag_notify_one(volatile atomic_flag* __o) _NOEXCEPT {
166170
__o->notify_one();
167171
}
168172

169-
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void atomic_flag_notify_one(atomic_flag* __o) _NOEXCEPT {
173+
inline _LIBCPP_DEPRECATED_ATOMIC_SYNC _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void
174+
atomic_flag_notify_one(atomic_flag* __o) _NOEXCEPT {
170175
__o->notify_one();
171176
}
172177

173-
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void
178+
inline _LIBCPP_DEPRECATED_ATOMIC_SYNC _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void
174179
atomic_flag_notify_all(volatile atomic_flag* __o) _NOEXCEPT {
175180
__o->notify_all();
176181
}
177182

178-
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void atomic_flag_notify_all(atomic_flag* __o) _NOEXCEPT {
183+
inline _LIBCPP_DEPRECATED_ATOMIC_SYNC _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_SYNC void
184+
atomic_flag_notify_all(atomic_flag* __o) _NOEXCEPT {
179185
__o->notify_all();
180186
}
181187

libcxx/include/__config

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -956,6 +956,14 @@ typedef __char32_t char32_t;
956956
# define _LIBCPP_DEPRECATED_(m)
957957
# endif
958958

959+
# if _LIBCPP_STD_VER < 20
960+
# define _LIBCPP_DEPRECATED_ATOMIC_SYNC \
961+
_LIBCPP_DEPRECATED_("The C++20 synchronization library has been deprecated prior to C++20. Please update to " \
962+
"using -std=c++20 if you need to use these facilities.")
963+
# else
964+
# define _LIBCPP_DEPRECATED_ATOMIC_SYNC /* nothing */
965+
# endif
966+
959967
# if !defined(_LIBCPP_CXX03_LANG)
960968
# define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED
961969
# else

libcxx/include/barrier

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ public:
257257
# endif // !_LIBCPP_HAS_NO_TREE_BARRIER
258258

259259
template <class _CompletionF = __empty_completion>
260-
class barrier {
260+
class _LIBCPP_DEPRECATED_ATOMIC_SYNC barrier {
261261
__barrier_base<_CompletionF> __b_;
262262

263263
public:

libcxx/include/latch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ _LIBCPP_PUSH_MACROS
6666

6767
_LIBCPP_BEGIN_NAMESPACE_STD
6868

69-
class latch {
69+
class _LIBCPP_DEPRECATED_ATOMIC_SYNC latch {
7070
__atomic_base<ptrdiff_t> __a_;
7171

7272
public:

libcxx/include/semaphore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ private:
127127
};
128128

129129
template <ptrdiff_t __least_max_value = _LIBCPP_SEMAPHORE_MAX>
130-
class counting_semaphore {
130+
class _LIBCPP_DEPRECATED_ATOMIC_SYNC counting_semaphore {
131131
__atomic_semaphore_base __semaphore_;
132132

133133
public:
@@ -172,7 +172,9 @@ public:
172172
}
173173
};
174174

175-
using binary_semaphore = counting_semaphore<1>;
175+
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
176+
using binary_semaphore _LIBCPP_DEPRECATED_ATOMIC_SYNC = counting_semaphore<1>;
177+
_LIBCPP_SUPPRESS_DEPRECATED_POP
176178

177179
_LIBCPP_END_NAMESPACE_STD
178180

libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_notify_all.pass.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@
77
//===----------------------------------------------------------------------===//
88
//
99
// UNSUPPORTED: no-threads
10-
// XFAIL: c++03
10+
// UNSUPPORTED: c++03
1111
// XFAIL: !has-1024-bit-atomics
1212

13+
// Until we drop support for the synchronization library in C++11/14/17
14+
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
15+
1316
// XFAIL: availability-synchronization_library-missing
1417

1518
// <atomic>

libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_notify_one.pass.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@
77
//===----------------------------------------------------------------------===//
88
//
99
// UNSUPPORTED: no-threads
10-
// XFAIL: c++03
10+
// UNSUPPORTED: c++03
1111
// XFAIL: !has-1024-bit-atomics
1212

13+
// Until we drop support for the synchronization library in C++11/14/17
14+
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
15+
1316
// XFAIL: availability-synchronization_library-missing
1417

1518
// <atomic>

libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_wait.pass.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@
77
//===----------------------------------------------------------------------===//
88
//
99
// UNSUPPORTED: no-threads
10-
// XFAIL: c++03
10+
// UNSUPPORTED: c++03
1111
// XFAIL: !has-1024-bit-atomics
1212

13+
// Until we drop support for the synchronization library in C++11/14/17
14+
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
15+
1316
// XFAIL: availability-synchronization_library-missing
1417

1518
// <atomic>

libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_wait_explicit.pass.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@
77
//===----------------------------------------------------------------------===//
88
//
99
// UNSUPPORTED: no-threads
10-
// XFAIL: c++03
10+
// UNSUPPORTED: c++03
1111
// XFAIL: !has-1024-bit-atomics
1212

13+
// Until we drop support for the synchronization library in C++11/14/17
14+
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
15+
1316
// XFAIL: availability-synchronization_library-missing
1417

1518
// <atomic>

libcxx/test/std/thread/thread.barrier/arrive.pass.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
// UNSUPPORTED: no-threads
1010
// UNSUPPORTED: c++03, c++11
1111

12+
// Until we drop support for the synchronization library in C++11/14/17
13+
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
14+
1215
// XFAIL: availability-synchronization_library-missing
1316

1417
// <barrier>

libcxx/test/std/thread/thread.barrier/arrive_and_drop.pass.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
// UNSUPPORTED: no-threads
1010
// UNSUPPORTED: c++03, c++11
1111

12+
// Until we drop support for the synchronization library in C++11/14/17
13+
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
14+
1215
// XFAIL: availability-synchronization_library-missing
1316

1417
// <barrier>

libcxx/test/std/thread/thread.barrier/arrive_and_wait.pass.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
// UNSUPPORTED: no-threads
1010
// UNSUPPORTED: c++03, c++11
1111

12+
// Until we drop support for the synchronization library in C++11/14/17
13+
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
14+
1215
// XFAIL: availability-synchronization_library-missing
1316

1417
// <barrier>

libcxx/test/std/thread/thread.barrier/completion.pass.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
// UNSUPPORTED: no-threads
1010
// UNSUPPORTED: c++03, c++11
1111

12+
// Until we drop support for the synchronization library in C++11/14/17
13+
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
14+
1215
// XFAIL: availability-synchronization_library-missing
1316

1417
// <barrier>

libcxx/test/std/thread/thread.barrier/ctor.compile.pass.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
// UNSUPPORTED: no-threads
1010
// UNSUPPORTED: c++03, c++11
1111

12+
// Until we drop support for the synchronization library in C++11/14/17
13+
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
14+
1215
// <barrier>
1316

1417
// explicit barrier(ptrdiff_t __count, _CompletionF __completion = _CompletionF());

libcxx/test/std/thread/thread.barrier/max.pass.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
// UNSUPPORTED: no-threads
1010
// UNSUPPORTED: c++03, c++11
1111

12+
// Until we drop support for the synchronization library in C++11/14/17
13+
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
14+
1215
// <barrier>
1316

1417
#include <barrier>

libcxx/test/std/thread/thread.latch/arrive_and_wait.pass.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
// UNSUPPORTED: no-threads
1010
// UNSUPPORTED: c++03, c++11
1111

12+
// Until we drop support for the synchronization library in C++11/14/17
13+
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
14+
1215
// XFAIL: availability-synchronization_library-missing
1316

1417
// <latch>

libcxx/test/std/thread/thread.latch/count_down.pass.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
// UNSUPPORTED: no-threads
1010
// UNSUPPORTED: c++03, c++11
1111

12+
// Until we drop support for the synchronization library in C++11/14/17
13+
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
14+
1215
// XFAIL: availability-synchronization_library-missing
1316

1417
// <latch>

libcxx/test/std/thread/thread.latch/ctor.pass.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
// UNSUPPORTED: no-threads
1010
// UNSUPPORTED: c++03, c++11
1111

12+
// Until we drop support for the synchronization library in C++11/14/17
13+
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
14+
1215
// <latch>
1316

1417
// inline constexpr explicit latch(ptrdiff_t __expected);

libcxx/test/std/thread/thread.latch/max.pass.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
// UNSUPPORTED: no-threads
1010
// UNSUPPORTED: c++03, c++11
1111

12+
// Until we drop support for the synchronization library in C++11/14/17
13+
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
14+
1215
// <latch>
1316

1417
#include <latch>

libcxx/test/std/thread/thread.latch/try_wait.pass.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
// UNSUPPORTED: no-threads
1010
// UNSUPPORTED: c++03, c++11
1111

12+
// Until we drop support for the synchronization library in C++11/14/17
13+
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
14+
1215
// XFAIL: availability-synchronization_library-missing
1316

1417
// <latch>

libcxx/test/std/thread/thread.semaphore/acquire.pass.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
// UNSUPPORTED: no-threads
1010
// UNSUPPORTED: c++03, c++11
1111

12+
// Until we drop support for the synchronization library in C++11/14/17
13+
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
14+
1215
// XFAIL: availability-synchronization_library-missing
1316

1417
// <semaphore>

libcxx/test/std/thread/thread.semaphore/binary.pass.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
// UNSUPPORTED: no-threads
1010
// UNSUPPORTED: c++03, c++11
1111

12+
// Until we drop support for the synchronization library in C++11/14/17
13+
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
14+
1215
// XFAIL: availability-synchronization_library-missing
1316

1417
// <semaphore>

libcxx/test/std/thread/thread.semaphore/ctor.compile.pass.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
// UNSUPPORTED: no-threads
1010
// UNSUPPORTED: c++03, c++11
1111

12+
// Until we drop support for the synchronization library in C++11/14/17
13+
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
14+
1215
// <semaphore>
1316

1417
// constexpr explicit counting_semaphore(ptrdiff_t desired);

libcxx/test/std/thread/thread.semaphore/max.pass.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
// UNSUPPORTED: no-threads
1010
// UNSUPPORTED: c++03, c++11
1111

12+
// Until we drop support for the synchronization library in C++11/14/17
13+
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
14+
1215
// <semaphore>
1316

1417
#include <semaphore>

0 commit comments

Comments
 (0)