From: Jonathan Wakely Date: Thu, 8 Jan 2026 14:03:01 +0000 (+0000) Subject: libstdc++: Simplify use_proxy_wait function X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5031cc843a3ae1385c22b174c210dff41449a5cc;p=thirdparty%2Fgcc.git libstdc++: Simplify use_proxy_wait function The __wait_args::_M_setup_proxy_wait function must only be called when _M_obj == addr is true, so it's redundant for _M_setup_proxy_wait to pass addr to use_proxy_wait. That address is already passed as args._M_old anyway. libstdc++-v3/ChangeLog: * src/c++20/atomic.cc (use_proxy_wait): Remove unused second parameter. (__wait_args::_M_setup_proxy_wait): Remove second argument. (__notify_impl): Likewise. Reviewed-by: Tomasz KamiƄski --- diff --git a/libstdc++-v3/src/c++20/atomic.cc b/libstdc++-v3/src/c++20/atomic.cc index cbff5e9ba1a..80558a1ad9e 100644 --- a/libstdc++-v3/src/c++20/atomic.cc +++ b/libstdc++-v3/src/c++20/atomic.cc @@ -280,8 +280,7 @@ namespace [[gnu::always_inline]] inline bool - use_proxy_wait([[maybe_unused]] const __wait_args_base& args, - [[maybe_unused]] const void* /* addr */) + use_proxy_wait([[maybe_unused]] const __wait_args_base& args) { #ifdef _GLIBCXX_HAVE_PLATFORM_WAIT if constexpr (__platform_wait_uses_type) @@ -324,7 +323,7 @@ __wait_args::_M_setup_proxy_wait(const void* addr) if (addr == _M_obj) { - if (!use_proxy_wait(*this, addr)) // We can wait on this address directly. + if (!use_proxy_wait(*this)) // We can wait on this address directly. return false; // This will be a proxy wait, so get a waitable state. @@ -384,7 +383,7 @@ __notify_impl([[maybe_unused]] const void* __addr, [[maybe_unused]] bool __all, const __wait_args_base& __args) { const bool __track_contention = __args & __wait_flags::__track_contention; - const bool proxy_wait = use_proxy_wait(__args, __addr); + const bool proxy_wait = use_proxy_wait(__args); [[maybe_unused]] auto* __wait_addr = static_cast(__addr);