[PATCH] libstdc++: Fix errors in atomic timed waiting functions
Jonathan Wakely
jwakely@redhat.com
Tue Jun 3 10:03:47 GMT 2025
On Tue, 3 Jun 2025 at 11:01, Jonathan Wakely <jwakely@redhat.com> wrote:
>
> On Tue, 3 Jun 2025 at 09:38, Tomasz Kaminski wrote:
> >
> >
> >
> > 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.
>
> I'm actually going to move the &__args to __args change from the "Fix
Oops, I mean move the __res.first to !__res._M_timeout change from
that patch to this one.
> incorrect comments on atomic timed waits" patch to this one, because
> they touch adjacent lines in the same function. That might as well be
> done in one patch.
>
>
>
>
> >>
> >>
> >> 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
> >>
More information about the Libstdc++
mailing list