NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: lib/56275: pthread_cond_timedwait broken
The following reply was made to PR lib/56275; it has been noted by GNATS.
From: David Holland <dholland-bugs%netbsd.org@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc:
Subject: Re: lib/56275: pthread_cond_timedwait broken
Date: Fri, 25 Jun 2021 06:31:05 +0000
On Fri, Jun 25, 2021 at 06:25:02AM +0000, David Holland wrote:
> The following reply was made to PR lib/56275; it has been noted by GNATS.
>
> From: David Holland <dholland-bugs%netbsd.org@localhost>
> To: gnats-bugs%netbsd.org@localhost
> Cc:
> Subject: Re: lib/56275: pthread_cond_timedwait broken
> Date: Fri, 25 Jun 2021 06:21:38 +0000
>
> On Fri, Jun 25, 2021 at 01:30:01AM +0000, dholland%NetBSD.org@localhost wrote:
> > then.tv_sec += ((unsigned long long)usecs * 1000 + start.tv_nsec) / 1000000000;
> > then.tv_nsec = ((unsigned long long)usecs * 1000 + start.tv_nsec) % 1000000000;
>
> mlelstv points out: that += should be +
or rather, what he actually said is that the += is wrong, and then
because it's late I did the wrong thing and then wrote a different
wrong thing here.
then.tv_sec = start.tv_sec;
then.tv_sec += ...
then.tv_nsec = ...
and with that and the [thread %u trying cond %u] print commented out,
on each run I get about a dozen spurious early wakeups after the
initialization phase ends.
--
David A. Holland
dholland%netbsd.org@localhost
Home |
Main Index |
Thread Index |
Old Index