diff options
author | jhb <jhb@FreeBSD.org> | 2011-02-04 14:16:41 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2011-02-04 14:16:41 +0000 |
commit | 853e3285412a4f4ec7478a6cff3d9b8ba77e0ec6 (patch) | |
tree | 45718ddb57a81934cc8a0339d24fe33bc3d66b5b /sys/kern/subr_turnstile.c | |
parent | a8ce1decaaa68bd7263d75af24a5d26212201174 (diff) | |
download | FreeBSD-src-853e3285412a4f4ec7478a6cff3d9b8ba77e0ec6.zip FreeBSD-src-853e3285412a4f4ec7478a6cff3d9b8ba77e0ec6.tar.gz |
Always assert that the turnstile chain lock is held in turnstile_wait()
and remove a duplicate hash lookup.
MFC after: 1 week
Diffstat (limited to 'sys/kern/subr_turnstile.c')
-rw-r--r-- | sys/kern/subr_turnstile.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/kern/subr_turnstile.c b/sys/kern/subr_turnstile.c index 114b139..1d32d66 100644 --- a/sys/kern/subr_turnstile.c +++ b/sys/kern/subr_turnstile.c @@ -685,8 +685,8 @@ turnstile_wait(struct turnstile *ts, struct thread *owner, int queue) * turnstile already in use by this lock. */ tc = TC_LOOKUP(ts->ts_lockobj); + mtx_assert(&tc->tc_lock, MA_OWNED); if (ts == td->td_turnstile) { - mtx_assert(&tc->tc_lock, MA_OWNED); #ifdef TURNSTILE_PROFILING tc->tc_depth++; if (tc->tc_depth > tc->tc_max_depth) { @@ -695,7 +695,6 @@ turnstile_wait(struct turnstile *ts, struct thread *owner, int queue) turnstile_max_depth = tc->tc_max_depth; } #endif - tc = TC_LOOKUP(ts->ts_lockobj); LIST_INSERT_HEAD(&tc->tc_turnstiles, ts, ts_hash); KASSERT(TAILQ_EMPTY(&ts->ts_pending), ("thread's turnstile has pending threads")); |