diff options
author | Mateusz Guzik <mjg@FreeBSD.org> | 2017-11-17 23:27:06 +0000 |
---|---|---|
committer | Mateusz Guzik <mjg@FreeBSD.org> | 2017-11-17 23:27:06 +0000 |
commit | 284194f183196a48200fecabe11bcfc09800b80f (patch) | |
tree | 659c5da53ce55727d695b4798e5a2a2234938e1d | |
parent | 66f84fabb33892cc941ded8c07de2b8c6523fd10 (diff) | |
download | src-284194f183196a48200fecabe11bcfc09800b80f.tar.gz src-284194f183196a48200fecabe11bcfc09800b80f.zip |
locks: fix compilation issues without SMP or KDTRACE_HOOKS
Notes
Notes:
svn path=/head/; revision=325963
-rw-r--r-- | sys/kern/kern_mutex.c | 5 | ||||
-rw-r--r-- | sys/kern/kern_sx.c | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/sys/kern/kern_mutex.c b/sys/kern/kern_mutex.c index 063456ec9f97..9438bf583e21 100644 --- a/sys/kern/kern_mutex.c +++ b/sys/kern/kern_mutex.c @@ -462,9 +462,7 @@ __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v) struct mtx *m; struct turnstile *ts; uintptr_t tid; -#ifdef ADAPTIVE_MUTEXES struct thread *owner; -#endif #ifdef KTR int cont_logged = 0; #endif @@ -629,6 +627,9 @@ __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v) #ifdef KDTRACE_HOOKS sleep_time -= lockstat_nsecs(&m->lock_object); #endif +#ifndef ADAPTIVE_MUTEXES + owner = mtx_owner(m); +#endif MPASS(owner == mtx_owner(m)); turnstile_wait(ts, owner, TS_EXCLUSIVE_QUEUE); #ifdef KDTRACE_HOOKS diff --git a/sys/kern/kern_sx.c b/sys/kern/kern_sx.c index 6629b0a63fdd..a5c2c801b414 100644 --- a/sys/kern/kern_sx.c +++ b/sys/kern/kern_sx.c @@ -520,8 +520,8 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, uintptr_t tid, int opts, #endif #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING) uintptr_t state; - int extra_work; #endif + int extra_work = 0; if (SCHEDULER_STOPPED()) return (0); @@ -880,8 +880,8 @@ _sx_slock_hard(struct sx *sx, int opts, const char *file, int line, uintptr_t x) #endif #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING) uintptr_t state; - int extra_work; #endif + int extra_work = 0; if (SCHEDULER_STOPPED()) return (0); |