diff options
author | rwatson <rwatson@FreeBSD.org> | 2007-05-23 17:27:01 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2007-05-23 17:27:01 +0000 |
commit | 6d0d9698735c8278ff75b4137327018a8505c8b3 (patch) | |
tree | 7b7d0f424c3a16529b516a9bbdd55dbfdc9e7d76 /sys/kern/kern_clock.c | |
parent | 649ffbffeb734a60dea8b8f41858a4288cb68836 (diff) | |
download | FreeBSD-src-6d0d9698735c8278ff75b4137327018a8505c8b3.zip FreeBSD-src-6d0d9698735c8278ff75b4137327018a8505c8b3.tar.gz |
Initialize time_lock before calling cpu_initclocks(). This corrects a
race condition in which hardclock fires before the mutex is initialized
leading to a "corrupt spinlock" panic.
Submitted by: attilio
Diffstat (limited to 'sys/kern/kern_clock.c')
-rw-r--r-- | sys/kern/kern_clock.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c index a12bd70..f75555b 100644 --- a/sys/kern/kern_clock.c +++ b/sys/kern/kern_clock.c @@ -174,8 +174,8 @@ initclocks(dummy) * Set divisors to 1 (normal case) and let the machine-specific * code do its bit. */ - cpu_initclocks(); mtx_init(&time_lock, "time lock", NULL, MTX_SPIN); + cpu_initclocks(); /* * Compute profhz/stathz, and fix profhz if needed. |