[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


================
@@ -137,17 +175,18 @@ _LIBCPP_HIDE_FROM_ABI bool __cxx_nonatomic_compare_equal(_Tp const& __lhs, _Tp c
 
 template <class _Tp>
 struct __atomic_compare_unequal_to {
-  _Tp __val;
-  _LIBCPP_HIDE_FROM_ABI bool operator()(_Tp& __current_val) const {
-    return !std::__cxx_nonatomic_compare_equal(__current_val, __val);
+  _Tp __val_;
+  _LIBCPP_HIDE_FROM_ABI bool operator()(const _Tp& __arg) const {
+    return !std::__cxx_nonatomic_compare_equal(__arg, __val_);
----------------
ldionne wrote:

Really small nitpick, but let's do this renaming in a separate commit. No need for a review or CI or anything, let's just land these three lines right away so they go away from the diff when you update the patch.

https://github.com/llvm/llvm-project/pull/81427


More information about the libcxx-commits mailing list