[libcxx-commits] [libcxx] [libc++] refactor `cxx_atomic_wait` to make it reusable for atomic_ref (PR #81427)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Mar 1 09:21:04 PST 2024
================
@@ -56,42 +90,39 @@ __libcpp_atomic_monitor(__cxx_atomic_contention_t const volatile*);
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void
__libcpp_atomic_wait(__cxx_atomic_contention_t const volatile*, __cxx_contention_t);
-template <class _Atp, class _Poll>
-struct __libcpp_atomic_wait_backoff_impl {
- _Atp* __a_;
+template <class _AtomicWaitable, class _Poll>
+struct __atomic_wait_backoff_impl {
+ const _AtomicWaitable& __a_;
_Poll __poll_;
memory_order __order_;
_LIBCPP_AVAILABILITY_SYNC
_LIBCPP_HIDE_FROM_ABI bool
- __poll_or_get_monitor(__cxx_atomic_contention_t const volatile*, __cxx_contention_t& __monitor) const {
- // In case the atomic can be waited on directly, the monitor value is just
- // the value of the atomic.
- // `__poll_` takes the current value of the atomic as an in-out argument
----------------
ldionne wrote:
Did you intent to remove this part of the comment, or is that a rebase artifact?
https://github.com/llvm/llvm-project/pull/81427
More information about the libcxx-commits
mailing list