Skip to content

Commit f151e17

Browse files
committed
rename '_cxx_atomic_wait_fn' to '__cxx_atomic_wait_unless'
1 parent 5541162 commit f151e17

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

libcxx/include/__atomic/atomic_sync.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,12 @@ struct __libcpp_atomic_wait_backoff_impl {
105105
// predicate (is the loaded value unequal to `old`?), the predicate function is
106106
// specified as an argument. The loaded value is given as an in-out argument to
107107
// the predicate. If the predicate function returns `true`,
108-
// `_cxx_atomic_wait_fn` will return. If the predicate function returns
108+
// `_cxx_atomic_wait_unless` will return. If the predicate function returns
109109
// `false`, it must set the argument to its current understanding of the atomic
110110
// value. The predicate function must not return `false` spuriously.
111111
template <class _Atp, class _Poll>
112112
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void
113-
__cxx_atomic_wait_fn(_Atp* __a, _Poll&& __poll, memory_order __order) {
113+
__cxx_atomic_wait_unless(_Atp* __a, _Poll&& __poll, memory_order __order) {
114114
__libcpp_atomic_wait_poll_impl<_Atp, __decay_t<_Poll> > __poll_fn = {__a, __poll, __order};
115115
__libcpp_atomic_wait_backoff_impl<_Atp, __decay_t<_Poll> > __backoff_fn = {__a, __poll, __order};
116116
(void)std::__libcpp_thread_poll_with_backoff(__poll_fn, __backoff_fn);
@@ -123,7 +123,7 @@ _LIBCPP_HIDE_FROM_ABI void __cxx_atomic_notify_all(__cxx_atomic_impl<_Tp> const
123123
template <class _Tp>
124124
_LIBCPP_HIDE_FROM_ABI void __cxx_atomic_notify_one(__cxx_atomic_impl<_Tp> const volatile*) {}
125125
template <class _Atp, class _Poll>
126-
_LIBCPP_HIDE_FROM_ABI void __cxx_atomic_wait_fn(_Atp* __a, _Poll&& __poll, memory_order __order) {
126+
_LIBCPP_HIDE_FROM_ABI void __cxx_atomic_wait_unless(_Atp* __a, _Poll&& __poll, memory_order __order) {
127127
__libcpp_atomic_wait_poll_impl<_Atp, __decay_t<_Poll> > __poll_fn = {__a, __poll, __order};
128128
(void)std::__libcpp_thread_poll_with_backoff(__poll_fn, __spinning_backoff_policy());
129129
}
@@ -147,7 +147,7 @@ template <class _Atp, class _Tp>
147147
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void
148148
__cxx_atomic_wait(_Atp* __a, _Tp const __val, memory_order __order) {
149149
__cxx_atomic_wait_poll_fn_impl<_Tp> __poll_fn = {__val};
150-
std::__cxx_atomic_wait_fn(__a, __poll_fn, __order);
150+
std::__cxx_atomic_wait_unless(__a, __poll_fn, __order);
151151
}
152152

153153
_LIBCPP_END_NAMESPACE_STD

libcxx/include/latch

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public:
102102
return try_wait_impl(__value);
103103
}
104104
inline _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void wait() const {
105-
__cxx_atomic_wait_fn(
105+
__cxx_atomic_wait_unless(
106106
&__a_.__a_, [this](ptrdiff_t& __value) -> bool { return try_wait_impl(__value); }, memory_order_acquire);
107107
}
108108
inline _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void arrive_and_wait(ptrdiff_t __update = 1) {

libcxx/include/semaphore

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public:
9999
}
100100
}
101101
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void acquire() {
102-
__cxx_atomic_wait_fn(
102+
__cxx_atomic_wait_unless(
103103
&__a_.__a_, [this](ptrdiff_t& __old) { return __try_acquire_impl(__old); }, memory_order_relaxed);
104104
}
105105
template <class _Rep, class _Period>

0 commit comments

Comments
 (0)