Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Sep 1996 05:26:36 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        freebsd-current@FreeBSD.ORG, j@uriah.heep.sax.de
Subject:   Re: fixing accesses to volatile variable `time'
Message-ID:  <199609061926.FAA13881@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>pcvt references the `time' variable for the only purpose to avoid
>rescheduling the screen saver more than once per second.  I would
>consider access of this kind being too less important to muck with the
>ipl.  (Nothing bad happens when the clock interrupt occurs inmidst
>this test.)

I noticed similar cases in the networking code.  These cases could use
a macro sloppytime().  This would normally be defined as time.tv_sec.
It usually gives the current time in seconds, but callers must be
prepared for it quite often being wrong by -1 and sometimes being
random.

pcvt mucks with the ipl anyway.  It misuses splhigh().  It should use
spltty() for its own stuff and splclock() if it really cares about
the time.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199609061926.FAA13881>