[gcc r16-6659] libstdc++: Simplify use_proxy_wait function
Jonathan Wakely
redi@gcc.gnu.org
Fri Jan 9 19:23:29 GMT 2026
https://gcc.gnu.org/g:5031cc843a3ae1385c22b174c210dff41449a5cc
commit r16-6659-g5031cc843a3ae1385c22b174c210dff41449a5cc
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Thu Jan 8 14:03:01 2026 +0000
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 <tkaminsk@redhat.com>
Diff:
---
libstdc++-v3/src/c++20/atomic.cc | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/libstdc++-v3/src/c++20/atomic.cc b/libstdc++-v3/src/c++20/atomic.cc
index cbff5e9ba1a6..80558a1ad9e0 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<uint32_t>)
@@ -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<const __platform_wait_t*>(__addr);
More information about the Libstdc++-cvs
mailing list