[PATCH] libstdc++: Fix errors in atomic timed waiting functions
Tomasz Kaminski
tkaminsk@redhat.com
Tue Jun 3 08:37:51 GMT 2025
On Mon, Jun 2, 2025 at 10:59 PM Jonathan Wakely <jwakely@redhat.com> wrote:
> These function templates are apparently never used or instantiated,
> because they don't compile. This fixes them, but they're still unused.
> I plan to make use of them in a later commit.
>
> libstdc++-v3/ChangeLog:
>
> * include/bits/atomic_timed_wait.h (__atomic_wait_address_until_v):
> Do not take address of __args in call to __detail::__wait_until.
> (__atomic_wait_address_for_v): Change parameter type from
> time_point
> to duration.
> ---
>
> Tested x86_64-linux.
>
LGTM.
>
> libstdc++-v3/include/bits/atomic_timed_wait.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libstdc++-v3/include/bits/atomic_timed_wait.h
> b/libstdc++-v3/include/bits/atomic_timed_wait.h
> index e22c13f47b18..bd2e6bf61ecf 100644
> --- a/libstdc++-v3/include/bits/atomic_timed_wait.h
> +++ b/libstdc++-v3/include/bits/atomic_timed_wait.h
> @@ -157,7 +157,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> bool __bare_wait = false) noexcept
> {
> __detail::__wait_args __args{ __addr, __old, __order, __bare_wait };
> - auto __res = __detail::__wait_until(__addr, &__args, __atime);
> + auto __res = __detail::__wait_until(__addr, __args, __atime);
> return !__res._M_timeout; // C++26 will also return last observed
> __val
> }
>
> @@ -202,7 +202,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> __atomic_wait_address_for_v(const __detail::__platform_wait_t* __addr,
> __detail::__platform_wait_t __old,
> int __order,
> - const chrono::time_point<_Rep, _Period>&
> __rtime,
> + const chrono::duration<_Rep, _Period>&
> __rtime,
> bool __bare_wait = false) noexcept
> {
> __detail::__wait_args __args{ __addr, __old, __order, __bare_wait };
> --
> 2.49.0
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://gcc.gnu.org/pipermail/libstdc++/attachments/20250603/8cb67cda/attachment.htm>
More information about the Libstdc++
mailing list