diff options
author | phk <phk@FreeBSD.org> | 1998-03-30 09:56:58 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1998-03-30 09:56:58 +0000 |
commit | 9b703b14551addf9806978973e2ddc427d4908b4 (patch) | |
tree | 91f2de8432f719153d0de9465a9ebeee33c29077 /sys/kern/kern_threads.c | |
parent | add2782c4ec0d7c4447da2b33d1413a2754f8a3e (diff) | |
download | FreeBSD-src-9b703b14551addf9806978973e2ddc427d4908b4.zip FreeBSD-src-9b703b14551addf9806978973e2ddc427d4908b4.tar.gz |
Eradicate the variable "time" from the kernel, using various measures.
"time" wasn't a atomic variable, so splfoo() protection were needed
around any access to it, unless you just wanted the seconds part.
Most uses of time.tv_sec now uses the new variable time_second instead.
gettime() changed to getmicrotime(0.
Remove a couple of unneeded splfoo() protections, the new getmicrotime()
is atomic, (until Bruce sets a breakpoint in it).
A couple of places needed random data, so use read_random() instead
of mucking about with time which isn't random.
Add a new nfs_curusec() function.
Mark a couple of bogosities involving the now disappeard time variable.
Update ffs_update() to avoid the weird "== &time" checks, by fixing the
one remaining call that passwd &time as args.
Change profiling in ncr.c to use ticks instead of time. Resolution is
the same.
Add new function "tvtohz()" to avoid the bogus "splfoo(), add time, call
hzto() which subtracts time" sequences.
Reviewed by: bde
Diffstat (limited to 'sys/kern/kern_threads.c')
-rw-r--r-- | sys/kern/kern_threads.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/kern/kern_threads.c b/sys/kern/kern_threads.c index 27d7cec..03cc9c9 100644 --- a/sys/kern/kern_threads.c +++ b/sys/kern/kern_threads.c @@ -46,7 +46,7 @@ * in Germany will I accept domestic beer. This code may or may not work * and I certainly make no claims as to its fitness for *any* purpose. * - * $Id: kern_threads.c,v 1.5 1997/11/07 08:52:57 phk Exp $ + * $Id: kern_threads.c,v 1.6 1998/02/25 06:30:15 bde Exp $ */ #include <sys/param.h> @@ -91,10 +91,7 @@ thr_sleep(struct proc *p, struct thr_sleep_args *uap) { p->p_wakeup = 0; return (EINVAL); } - s = splclock(); - timevaladd(&atv, &time); - timo = hzto(&atv); - splx(s); + timo = tvtohz(&atv); } p->p_retval[0] = 0; |