summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_timeout.c
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1997-03-22 06:53:45 +0000
committerbde <bde@FreeBSD.org>1997-03-22 06:53:45 +0000
commit0bc178170104cff1e818e849d08a50c6a4ee0851 (patch)
tree1a4787be89dc6587f785bb211bf92dd0ce277648 /sys/kern/kern_timeout.c
parent5610d80b6231f85421e587a175ddd4d4b0c735c5 (diff)
downloadFreeBSD-src-0bc178170104cff1e818e849d08a50c6a4ee0851.zip
FreeBSD-src-0bc178170104cff1e818e849d08a50c6a4ee0851.tar.gz
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.
Diffstat (limited to 'sys/kern/kern_timeout.c')
-rw-r--r--sys/kern/kern_timeout.c13
1 files changed, 12 insertions, 1 deletions
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.
OpenPOWER on IntegriCloud