Date: Mon, 11 Jun 2012 22:05:07 +0200 From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: Hans Petter Selasky <hselasky@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r236909 - head/sbin/hastd Message-ID: <20120611200507.GG1399@garage.freebsd.pl> In-Reply-To: <201206111921.q5BJL0jP005127@svn.freebsd.org> References: <201206111921.q5BJL0jP005127@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--WkfBGePaEyrk4zXB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 11, 2012 at 07:21:00PM +0000, Hans Petter Selasky wrote: > Author: hselasky > Date: Mon Jun 11 19:20:59 2012 > New Revision: 236909 > URL: http://svn.freebsd.org/changeset/base/236909 >=20 > Log: > Use the correct clock source when computing timeouts. Could you please explain why? As you can see some lines above in cv_init(), we initialize condition variable with CLOCK_MONOTONIC too: error =3D pthread_condattr_setclock(&attr, CLOCK_MONOTONIC); > MFC after: 1 week >=20 > Modified: > head/sbin/hastd/synch.h >=20 > Modified: head/sbin/hastd/synch.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sbin/hastd/synch.h Mon Jun 11 19:09:55 2012 (r236908) > +++ head/sbin/hastd/synch.h Mon Jun 11 19:20:59 2012 (r236909) > @@ -168,7 +168,7 @@ cv_timedwait(pthread_cond_t *cv, pthread > return (false); > } > =20 > - error =3D clock_gettime(CLOCK_MONOTONIC, &ts); > + error =3D clock_gettime(CLOCK_REALTIME, &ts); > PJDLOG_ASSERT(error =3D=3D 0); > ts.tv_sec +=3D timeout; > error =3D pthread_cond_timedwait(cv, lock, &ts); --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --WkfBGePaEyrk4zXB Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEUEARECAAYFAk/WT3MACgkQForvXbEpPzQiHwCVHtg/PAnt03afKbDGvSt2NpPk xwCg0TWw3YuC6HXqA2dkiz6qDIsCe6A= =S3JO -----END PGP SIGNATURE----- --WkfBGePaEyrk4zXB--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120611200507.GG1399>