fix uninitialized variable warning in reader locks

This commit is contained in:
Matt Macy 2018-05-19 03:52:55 +00:00
parent f1b2eaf13b
commit 1dce110f63
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=333831
2 changed files with 4 additions and 4 deletions

View File

@ -887,7 +887,7 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v LOCK_FILE_LINE_ARG_DEF)
#ifdef ADAPTIVE_RWLOCKS
int spintries = 0;
int i, n;
enum { READERS, WRITER } sleep_reason;
enum { READERS, WRITER } sleep_reason = READERS;
#endif
uintptr_t x;
#ifdef LOCK_PROFILING

View File

@ -551,7 +551,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, int opts LOCK_FILE_LINE_ARG_DEF)
#ifdef ADAPTIVE_SX
volatile struct thread *owner;
u_int i, n, spintries = 0;
enum { READERS, WRITER } sleep_reason;
enum { READERS, WRITER } sleep_reason = READERS;
bool adaptive;
#endif
#ifdef LOCK_PROFILING
@ -568,7 +568,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, int opts LOCK_FILE_LINE_ARG_DEF)
int64_t all_time = 0;
#endif
#if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING)
uintptr_t state;
uintptr_t state = 0;
#endif
int extra_work = 0;
@ -944,7 +944,7 @@ _sx_slock_hard(struct sx *sx, int opts, uintptr_t x LOCK_FILE_LINE_ARG_DEF)
int64_t all_time = 0;
#endif
#if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING)
uintptr_t state;
uintptr_t state = 0;
#endif
int extra_work = 0;