Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-2-0]: src/sys/kern Pull up revision 1.5 (requested by fredb in ti...
details: https://anonhg.NetBSD.org/src/rev/98a45d49d51e
branches: netbsd-2-0
changeset: 561571:98a45d49d51e
user: tron <tron%NetBSD.org@localhost>
date: Tue Jun 22 08:49:57 2004 +0000
description:
Pull up revision 1.5 (requested by fredb in ticket #520):
Adjust code that tries to prevent cc_microtime() from going backwards
so that it doesn't fire when called twice in the same microsecond,
which can lead to large error accumulation.
Appears to fix "repeated gettimeofday() goes backwards" on a fast
alpha and i386 box.
diffstat:
sys/kern/kern_microtime.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diffs (27 lines):
diff -r 27397af0e154 -r 98a45d49d51e sys/kern/kern_microtime.c
--- a/sys/kern/kern_microtime.c Tue Jun 22 08:47:35 2004 +0000
+++ b/sys/kern/kern_microtime.c Tue Jun 22 08:49:57 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_microtime.c,v 1.4 2003/06/28 15:02:24 simonb Exp $ */
+/* $NetBSD: kern_microtime.c,v 1.4.4.1 2004/06/22 08:49:57 tron Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -54,7 +54,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: kern_microtime.c,v 1.4 2003/06/28 15:02:24 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_microtime.c,v 1.4.4.1 2004/06/22 08:49:57 tron Exp $");
#include "opt_multiprocessor.h"
@@ -137,7 +137,7 @@
usec += 1000000;
sec--;
}
- if (sec == 0) {
+ if (sec == 0 && usec > 0) {
t.tv_usec += usec + 1;
if (t.tv_usec >= 1000000) {
t.tv_usec -= 1000000;
Home |
Main Index |
Thread Index |
Old Index