- Replace a KASSERT() that knew too much about mutex internals with a
mtx_assert() that ensures the mutex we release during msleep() is both not recursed and owned by the current process.
This commit is contained in:
parent
f33a072eb9
commit
3ae4dd935b
@ -424,8 +424,7 @@ msleep(ident, mtx, priority, wmesg, timo)
|
|||||||
mtx_enter(&sched_lock, MTX_SPIN);
|
mtx_enter(&sched_lock, MTX_SPIN);
|
||||||
|
|
||||||
if (mtx != NULL) {
|
if (mtx != NULL) {
|
||||||
KASSERT(mtx->mtx_recurse == 0,
|
mtx_assert(mtx, MA_OWNED | MA_NOTRECURSED);
|
||||||
("sleeping on recursed mutex %s", mtx->mtx_description));
|
|
||||||
WITNESS_SAVE(mtx, mtx);
|
WITNESS_SAVE(mtx, mtx);
|
||||||
mtx_exit(mtx, MTX_DEF | MTX_NOSWITCH);
|
mtx_exit(mtx, MTX_DEF | MTX_NOSWITCH);
|
||||||
if (priority & PDROP)
|
if (priority & PDROP)
|
||||||
|
Loading…
Reference in New Issue
Block a user