From eb3a3bb8ce4ce2420919d03a3e9f9a2a4297c4d3 Mon Sep 17 00:00:00 2001 From: Thomas Rodgers Date: Wed, 9 Jun 2021 13:44:31 -0700 Subject: [PATCH] libstd++: Only support atomic_ref::wait tests which are always lockfree Fixes a regression on arm32 targets. libstdc++-v3/ChangeLog: * testsuite/29_atomics/atomic_ref/wait_notify.cc: Guard test logic with constexpr check for is_always_lock_free. --- .../testsuite/29_atomics/atomic_ref/wait_notify.cc | 25 ++++++++++++---------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_ref/wait_notify.cc b/libstdc++-v3/testsuite/29_atomics/atomic_ref/wait_notify.cc index 003b86c..b75e276 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic_ref/wait_notify.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic_ref/wait_notify.cc @@ -30,17 +30,20 @@ template void test (S va, S vb) { - S aa{ va }; - S bb{ vb }; - std::atomic_ref a{ aa }; - a.wait(bb); - std::thread t([&] - { - a.store(bb); - a.notify_one(); - }); - a.wait(aa); - t.join(); + if constexpr (std::atomic_ref::is_always_lock_free) + { + S aa{ va }; + S bb{ vb }; + std::atomic_ref a{ aa }; + a.wait(bb); + std::thread t([&] + { + a.store(bb); + a.notify_one(); + }); + a.wait(aa); + t.join(); + } } int -- 2.7.4