From 0bc178170104cff1e818e849d08a50c6a4ee0851 Mon Sep 17 00:00:00 2001 From: bde Date: Sat, 22 Mar 1997 06:53:45 +0000 Subject: Fixed some invalid (non-atomic) accesses to `time', mostly ones of the form `tv = time'. Use a new function gettime(). The current version just forces atomicicity without fixing precision or efficiency bugs. Simplified some related valid accesses by using the central function. --- sys/kern/kern_timeout.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'sys/kern/kern_timeout.c') diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c index 341c00e..e5fa539 100644 --- a/sys/kern/kern_timeout.c +++ b/sys/kern/kern_timeout.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_clock.c 8.5 (Berkeley) 1/21/94 - * $Id$ + * $Id: kern_clock.c,v 1.32 1997/02/22 09:39:02 peter Exp $ */ /* Portions of this software are covered by the following: */ @@ -799,6 +799,17 @@ untimeout(ftn, arg) splx(s); } +void +gettime(struct timeval *tvp) +{ + int s; + + s = splclock(); + /* XXX should use microtime() iff tv_usec is used. */ + *tvp = time; + splx(s); +} + /* * Compute number of hz until specified time. Used to * compute third argument to timeout() from an absolute time. -- cgit v1.1