libstdc++-v3/ChangeLog:
* include/bits/atomic_wait.h (__wait_args::_M_setup_proxy_wait):
Improve comment.
---
Tomasz asked for this comment to be updated for the recent changes, and
I forgot to do it.
Is this clearer now?
libstdc++-v3/include/bits/atomic_wait.h | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/libstdc++-v3/include/bits/atomic_wait.h
b/libstdc++-v3/include/bits/atomic_wait.h
index 8511e003abca..eff1be604eb4 100644
--- a/libstdc++-v3/include/bits/atomic_wait.h
+++ b/libstdc++-v3/include/bits/atomic_wait.h
@@ -287,8 +287,16 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
// Returns true if a proxy wait will be used for __addr, false otherwise.
- // If true, _M_wait_state, _M_obj, _M_obj_size, and _M_old are set.
- // If false, data members are unchanged.
+ // For the first call (from _M_setup_wait) `_M_obj` will equal `__addr`,
+ // and the library will decide whether to use a proxy wait.
+ // If it returns false, all data members are unchanged.
+ // If it returns true, _M_wait_state, _M_obj, and _M_obj_size refer to
+ // the proxy, and _M_old will contain a recent value of the proxy.
+ // Subsequent calls (from _M_on_wake) are only needed for proxy waits,
+ // when `_M_obj` is not equal to `__addr`. In this case, it returns true
+ // and the only effects are to update `_M_old` from the proxy.
+ // For the calls from `_M_on_wake the argument can be nullptr, because
+ // any value that is not equal to `_M_obj` has the same effect.
bool
_M_setup_proxy_wait(const void* __addr);
--
2.52.0