locks: fix compilation issues without SMP or KDTRACE_HOOKS

This commit is contained in:
mjg 2017-11-17 23:27:06 +00:00
parent 00464bff96
commit 3fb5232780
2 changed files with 5 additions and 4 deletions

View File

@ -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
@ -628,6 +626,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);

View File

@ -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);