Skip to content

Commit 9917484

Browse files
authored
[libc++] Make std::jthread supported in non-experimental mode (#107900)
We waited before supporting std::jthread fully because we wanted to investigate other implementation strategies (in particular one involving std::mutex). Since then, we did some benchmarking and decided that we wouldn't be moving forward with std::mutex. Hence, there is no real reason to punt on making std::jthread & friends non-experimental.
1 parent 1642f64 commit 9917484

File tree

20 files changed

+49
-58
lines changed

20 files changed

+49
-58
lines changed

libcxx/docs/ReleaseNotes/20.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Implemented Papers
4141
- P2747R2: ``constexpr`` placement new (`Github <https://github.com/llvm/llvm-project/issues/105427>`__)
4242
- P2609R3: Relaxing Ranges Just A Smidge (`Github <https://github.com/llvm/llvm-project/issues/105253>`__)
4343
- P2985R0: A type trait for detecting virtual base classes (`Github <https://github.com/llvm/llvm-project/issues/105432>`__)
44+
- ``std::jthread`` and ``<stop_token>`` are not guarded behind ``-fexperimental-library`` anymore
4445

4546

4647
Improvements and New Features

libcxx/docs/Status/Cxx20Papers.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
"`P0553R4 <https://wg21.link/P0553R4>`__","Bit operations","2019-07 (Cologne)","|Complete|","9.0",""
106106
"`P0631R8 <https://wg21.link/P0631R8>`__","Math Constants","2019-07 (Cologne)","|Complete|","11.0",""
107107
"`P0645R10 <https://wg21.link/P0645R10>`__","Text Formatting","2019-07 (Cologne)","|Complete|","14.0","The implementation was complete since LLVM 14, but the feature-test macro was not set until LLVM 19"
108-
"`P0660R10 <https://wg21.link/P0660R10>`__","Stop Token and Joining Thread, Rev 10.","2019-07 (Cologne)","|Complete|","18.0","The paper is implemented but the features are experimental and can be enabled via ``-fexperimental-library``."
108+
"`P0660R10 <https://wg21.link/P0660R10>`__","Stop Token and Joining Thread, Rev 10.","2019-07 (Cologne)","|Complete|","20.0","The feature was implemented since LLVM 18 but was guarded behind ``-fexperimental-library``."
109109
"`P0784R7 <https://wg21.link/P0784R7>`__","More constexpr containers","2019-07 (Cologne)","|Complete|","12.0",""
110110
"`P0980R1 <https://wg21.link/P0980R1>`__","Making std::string constexpr","2019-07 (Cologne)","|Complete|","15.0",""
111111
"`P1004R2 <https://wg21.link/P1004R2>`__","Making std::vector constexpr","2019-07 (Cologne)","|Complete|","15.0",""

libcxx/docs/UserDocumentation.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,8 @@ The following features are currently considered experimental and are only provid
6969
when ``-fexperimental-library`` is passed:
7070

7171
* The parallel algorithms library (``<execution>`` and the associated algorithms)
72-
* ``std::stop_token``, ``std::stop_source`` and ``std::stop_callback``
73-
* ``std::jthread``
7472
* ``std::chrono::tzdb`` and related time zone functionality
73+
* ``<syncstream>``
7574

7675
.. note::
7776
Experimental libraries are experimental.

libcxx/include/__config

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,6 @@ _LIBCPP_HARDENING_MODE_DEBUG
224224
// easier to grep for target specific flags once the feature is complete.
225225
# if !defined(_LIBCPP_ENABLE_EXPERIMENTAL) && !defined(_LIBCPP_BUILDING_LIBRARY)
226226
# define _LIBCPP_HAS_NO_INCOMPLETE_PSTL
227-
# define _LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN
228227
# define _LIBCPP_HAS_NO_EXPERIMENTAL_TZDB
229228
# define _LIBCPP_HAS_NO_EXPERIMENTAL_SYNCSTREAM
230229
# endif

libcxx/include/__stop_token/atomic_unique_lock.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
//
88
//===----------------------------------------------------------------------===//
99

10-
#ifndef _LIBCPP___STOP_TOKEN_ATOMIC_UNIQUE_GUARD_H
11-
#define _LIBCPP___STOP_TOKEN_ATOMIC_UNIQUE_GUARD_H
10+
#ifndef _LIBCPP___STOP_TOKEN_ATOMIC_UNIQUE_LOCK_H
11+
#define _LIBCPP___STOP_TOKEN_ATOMIC_UNIQUE_LOCK_H
1212

1313
#include <__bit/popcount.h>
1414
#include <__config>
@@ -133,8 +133,8 @@ class _LIBCPP_AVAILABILITY_SYNC __atomic_unique_lock {
133133
_LIBCPP_HIDE_FROM_ABI static constexpr auto __set_locked_bit = [](_State __state) { return __state | _LockedBit; };
134134
};
135135

136-
#endif // _LIBCPP_STD_VER >= 20
136+
#endif // _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_THREADS)
137137

138138
_LIBCPP_END_NAMESPACE_STD
139139

140-
#endif // _LIBCPP___STOP_TOKEN_ATOMIC_UNIQUE_GUARD_H
140+
#endif // _LIBCPP___STOP_TOKEN_ATOMIC_UNIQUE_LOCK_H

libcxx/include/__stop_token/stop_callback.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ _LIBCPP_PUSH_MACROS
3131

3232
_LIBCPP_BEGIN_NAMESPACE_STD
3333

34-
#if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN) && !defined(_LIBCPP_HAS_NO_THREADS)
34+
#if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_THREADS)
3535

3636
template <class _Callback>
3737
class _LIBCPP_AVAILABILITY_SYNC stop_callback : private __stop_callback_base {
@@ -93,10 +93,10 @@ class _LIBCPP_AVAILABILITY_SYNC stop_callback : private __stop_callback_base {
9393
template <class _Callback>
9494
_LIBCPP_AVAILABILITY_SYNC stop_callback(stop_token, _Callback) -> stop_callback<_Callback>;
9595

96-
#endif // _LIBCPP_STD_VER >= 20
96+
#endif // _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_THREADS)
9797

9898
_LIBCPP_END_NAMESPACE_STD
9999

100100
_LIBCPP_POP_MACROS
101101

102-
#endif // _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN) && !defined(_LIBCPP_HAS_NO_THREADS)
102+
#endif // _LIBCPP___STOP_TOKEN_STOP_CALLBACK_H

libcxx/include/__stop_token/stop_source.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
_LIBCPP_BEGIN_NAMESPACE_STD
2424

25-
#if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN) && !defined(_LIBCPP_HAS_NO_THREADS)
25+
#if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_THREADS)
2626

2727
struct nostopstate_t {
2828
explicit nostopstate_t() = default;
@@ -84,8 +84,8 @@ class _LIBCPP_AVAILABILITY_SYNC stop_source {
8484
__intrusive_shared_ptr<__stop_state> __state_;
8585
};
8686

87-
#endif // _LIBCPP_STD_VER >= 20
87+
#endif // _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_THREADS)
8888

8989
_LIBCPP_END_NAMESPACE_STD
9090

91-
#endif // _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN) && !defined(_LIBCPP_HAS_NO_THREADS)
91+
#endif // _LIBCPP___STOP_TOKEN_STOP_SOURCE_H

libcxx/include/__stop_token/stop_token.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
_LIBCPP_BEGIN_NAMESPACE_STD
2222

23-
#if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN) && !defined(_LIBCPP_HAS_NO_THREADS)
23+
#if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_THREADS)
2424

2525
class _LIBCPP_AVAILABILITY_SYNC stop_token {
2626
public:
@@ -56,7 +56,7 @@ class _LIBCPP_AVAILABILITY_SYNC stop_token {
5656
_LIBCPP_HIDE_FROM_ABI explicit stop_token(const __intrusive_shared_ptr<__stop_state>& __state) : __state_(__state) {}
5757
};
5858

59-
#endif // _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN) && !defined(_LIBCPP_HAS_NO_THREADS)
59+
#endif // _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_THREADS)
6060

6161
_LIBCPP_END_NAMESPACE_STD
6262

libcxx/include/__thread/jthread.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
_LIBCPP_PUSH_MACROS
3131
#include <__undef_macros>
3232

33-
#if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN)
33+
#if _LIBCPP_STD_VER >= 20
3434

3535
_LIBCPP_BEGIN_NAMESPACE_STD
3636

@@ -127,7 +127,7 @@ class _LIBCPP_AVAILABILITY_SYNC jthread {
127127

128128
_LIBCPP_END_NAMESPACE_STD
129129

130-
#endif // _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN)
130+
#endif // _LIBCPP_STD_VER >= 20
131131

132132
_LIBCPP_POP_MACROS
133133

libcxx/include/condition_variable

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public:
173173
template <class _Lock, class _Rep, class _Period, class _Predicate>
174174
bool _LIBCPP_HIDE_FROM_ABI wait_for(_Lock& __lock, const chrono::duration<_Rep, _Period>& __d, _Predicate __pred);
175175

176-
# if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN)
176+
# if _LIBCPP_STD_VER >= 20
177177

178178
template <class _Lock, class _Predicate>
179179
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI bool wait(_Lock& __lock, stop_token __stoken, _Predicate __pred);
@@ -186,7 +186,7 @@ public:
186186
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI bool
187187
wait_for(_Lock& __lock, stop_token __stoken, const chrono::duration<_Rep, _Period>& __rel_time, _Predicate __pred);
188188

189-
# endif // _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN)
189+
# endif // _LIBCPP_STD_VER >= 20
190190
};
191191

192192
inline condition_variable_any::condition_variable_any() : __mut_(make_shared<mutex>()) {}
@@ -260,7 +260,7 @@ condition_variable_any::wait_for(_Lock& __lock, const chrono::duration<_Rep, _Pe
260260
return wait_until(__lock, chrono::steady_clock::now() + __d, std::move(__pred));
261261
}
262262

263-
# if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN)
263+
# if _LIBCPP_STD_VER >= 20
264264

265265
template <class _Lock, class _Predicate>
266266
bool condition_variable_any::wait(_Lock& __user_lock, stop_token __stoken, _Predicate __pred) {
@@ -341,7 +341,7 @@ bool condition_variable_any::wait_for(
341341
return wait_until(__lock, std::move(__stoken), chrono::steady_clock::now() + __rel_time, std::move(__pred));
342342
}
343343

344-
# endif // _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN)
344+
# endif // _LIBCPP_STD_VER >= 20
345345

346346
_LIBCPP_EXPORTED_FROM_ABI void notify_all_at_thread_exit(condition_variable&, unique_lock<mutex>);
347347

libcxx/include/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ __cpp_lib_void_t 201411L <type_traits>
417417
// # define __cpp_lib_is_layout_compatible 201907L
418418
# define __cpp_lib_is_nothrow_convertible 201806L
419419
// # define __cpp_lib_is_pointer_interconvertible 201907L
420-
# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN) && _LIBCPP_AVAILABILITY_HAS_SYNC
420+
# if !defined(_LIBCPP_HAS_NO_THREADS) && _LIBCPP_AVAILABILITY_HAS_SYNC
421421
# define __cpp_lib_jthread 201911L
422422
# endif
423423
# if !defined(_LIBCPP_HAS_NO_THREADS) && _LIBCPP_AVAILABILITY_HAS_SYNC

libcxx/modules/std/stop_token.inc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
export namespace std {
1111
#ifndef _LIBCPP_HAS_NO_THREADS
12-
# ifdef _LIBCPP_ENABLE_EXPERIMENTAL
1312
// [stoptoken], class stop_­token
1413
using std::stop_token;
1514

@@ -22,6 +21,5 @@ export namespace std {
2221

2322
// [stopcallback], class template stop_­callback
2423
using std::stop_callback;
25-
# endif // _LIBCPP_ENABLE_EXPERIMENTAL
26-
#endif // _LIBCPP_HAS_NO_THREADS
24+
#endif // _LIBCPP_HAS_NO_THREADS
2725
} // namespace std

libcxx/modules/std/thread.inc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ export namespace std {
1515
using std::swap;
1616

1717
// [thread.jthread.class], class jthread
18-
# if !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN)
1918
using std::jthread;
20-
# endif
2119

2220
// [thread.thread.this], namespace this_thread
2321
namespace this_thread {

libcxx/test/libcxx/experimental/fexperimental-library.compile.pass.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@
2020
# error "-fexperimental-library should enable the PSTL"
2121
#endif
2222

23-
#ifdef _LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN
24-
# error "-fexperimental-library should enable the stop_token"
25-
#endif
26-
2723
#ifdef _LIBCPP_HAS_NO_EXPERIMENTAL_TZDB
2824
# error "-fexperimental-library should enable the chrono TZDB"
2925
#endif

libcxx/test/std/language.support/support.limits/support.limits.general/stop_token.version.compile.pass.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
#elif TEST_STD_VER == 20
4646

47-
# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN) && (!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC)
47+
# if !defined(_LIBCPP_HAS_NO_THREADS) && (!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC)
4848
# ifndef __cpp_lib_jthread
4949
# error "__cpp_lib_jthread should be defined in c++20"
5050
# endif
@@ -53,13 +53,13 @@
5353
# endif
5454
# else
5555
# ifdef __cpp_lib_jthread
56-
# error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN) && (!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
56+
# error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && (!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
5757
# endif
5858
# endif
5959

6060
#elif TEST_STD_VER == 23
6161

62-
# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN) && (!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC)
62+
# if !defined(_LIBCPP_HAS_NO_THREADS) && (!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC)
6363
# ifndef __cpp_lib_jthread
6464
# error "__cpp_lib_jthread should be defined in c++23"
6565
# endif
@@ -68,13 +68,13 @@
6868
# endif
6969
# else
7070
# ifdef __cpp_lib_jthread
71-
# error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN) && (!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
71+
# error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && (!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
7272
# endif
7373
# endif
7474

7575
#elif TEST_STD_VER > 23
7676

77-
# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN) && (!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC)
77+
# if !defined(_LIBCPP_HAS_NO_THREADS) && (!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC)
7878
# ifndef __cpp_lib_jthread
7979
# error "__cpp_lib_jthread should be defined in c++26"
8080
# endif
@@ -83,7 +83,7 @@
8383
# endif
8484
# else
8585
# ifdef __cpp_lib_jthread
86-
# error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN) && (!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
86+
# error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && (!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
8787
# endif
8888
# endif
8989

libcxx/test/std/language.support/support.limits/support.limits.general/thread.version.compile.pass.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
# error "__cpp_lib_formatters should not be defined before c++23"
6262
# endif
6363

64-
# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN) && (!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC)
64+
# if !defined(_LIBCPP_HAS_NO_THREADS) && (!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC)
6565
# ifndef __cpp_lib_jthread
6666
# error "__cpp_lib_jthread should be defined in c++20"
6767
# endif
@@ -70,7 +70,7 @@
7070
# endif
7171
# else
7272
# ifdef __cpp_lib_jthread
73-
# error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN) && (!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
73+
# error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && (!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
7474
# endif
7575
# endif
7676

@@ -89,7 +89,7 @@
8989
# endif
9090
# endif
9191

92-
# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN) && (!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC)
92+
# if !defined(_LIBCPP_HAS_NO_THREADS) && (!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC)
9393
# ifndef __cpp_lib_jthread
9494
# error "__cpp_lib_jthread should be defined in c++23"
9595
# endif
@@ -98,7 +98,7 @@
9898
# endif
9999
# else
100100
# ifdef __cpp_lib_jthread
101-
# error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN) && (!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
101+
# error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && (!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
102102
# endif
103103
# endif
104104

@@ -117,7 +117,7 @@
117117
# endif
118118
# endif
119119

120-
# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN) && (!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC)
120+
# if !defined(_LIBCPP_HAS_NO_THREADS) && (!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC)
121121
# ifndef __cpp_lib_jthread
122122
# error "__cpp_lib_jthread should be defined in c++26"
123123
# endif
@@ -126,7 +126,7 @@
126126
# endif
127127
# else
128128
# ifdef __cpp_lib_jthread
129-
# error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN) && (!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
129+
# error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && (!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
130130
# endif
131131
# endif
132132

libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3908,7 +3908,7 @@
39083908
# error "__cpp_lib_is_within_lifetime should not be defined before c++26"
39093909
# endif
39103910

3911-
# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN) && (!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC)
3911+
# if !defined(_LIBCPP_HAS_NO_THREADS) && (!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC)
39123912
# ifndef __cpp_lib_jthread
39133913
# error "__cpp_lib_jthread should be defined in c++20"
39143914
# endif
@@ -3917,7 +3917,7 @@
39173917
# endif
39183918
# else
39193919
# ifdef __cpp_lib_jthread
3920-
# error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN) && (!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
3920+
# error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && (!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
39213921
# endif
39223922
# endif
39233923

@@ -5375,7 +5375,7 @@
53755375
# error "__cpp_lib_is_within_lifetime should not be defined before c++26"
53765376
# endif
53775377

5378-
# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN) && (!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC)
5378+
# if !defined(_LIBCPP_HAS_NO_THREADS) && (!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC)
53795379
# ifndef __cpp_lib_jthread
53805380
# error "__cpp_lib_jthread should be defined in c++23"
53815381
# endif
@@ -5384,7 +5384,7 @@
53845384
# endif
53855385
# else
53865386
# ifdef __cpp_lib_jthread
5387-
# error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN) && (!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
5387+
# error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && (!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
53885388
# endif
53895389
# endif
53905390

@@ -7199,7 +7199,7 @@
71997199
# endif
72007200
# endif
72017201

7202-
# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN) && (!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC)
7202+
# if !defined(_LIBCPP_HAS_NO_THREADS) && (!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC)
72037203
# ifndef __cpp_lib_jthread
72047204
# error "__cpp_lib_jthread should be defined in c++26"
72057205
# endif
@@ -7208,7 +7208,7 @@
72087208
# endif
72097209
# else
72107210
# ifdef __cpp_lib_jthread
7211-
# error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN) && (!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
7211+
# error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_HAS_NO_THREADS) && (!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!"
72127212
# endif
72137213
# endif
72147214

libcxx/test/std/thread/thread.condition/thread.condition.condvarany/wait_terminates.sh.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ int main(int argc, char **argv) {
137137
case 4: cv.wait_for(mut, wait, pred_function); break;
138138
case 5: cv.wait_until(mut, Clock::now() + wait); break;
139139
case 6: cv.wait_until(mut, Clock::now() + wait, pred_function); break;
140-
#if TEST_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN) && _LIBCPP_AVAILABILITY_HAS_SYNC
140+
#if TEST_STD_VER >= 20 && !(defined(_LIBCPP_VERSION) && !_LIBCPP_AVAILABILITY_HAS_SYNC)
141141
case 7: cv.wait(mut, std::stop_source{}.get_token(), pred_function); break;
142142
case 8: cv.wait_for(mut, std::stop_source{}.get_token(), wait, pred_function); break;
143143
case 9: cv.wait_until(mut, std::stop_source{}.get_token(), Clock::now() + wait, pred_function); break;
@@ -146,7 +146,7 @@ int main(int argc, char **argv) {
146146
case 8:
147147
case 9:
148148
return 0;
149-
#endif //TEST_STD_VER >=20 && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN)
149+
#endif
150150
default: assert(false);
151151
}
152152
} catch (...) {}

0 commit comments

Comments
 (0)