Correct handling of PDROP in msleep() to just skip the mtx_lock() rather

than clear the lock pointer so that sleepq_add() still gets the correct
lock pointer and doesn't bogusly trip an assertion.
This commit is contained in:
jhb 2004-03-02 14:58:33 +00:00
parent 2a81bc88dd
commit 6bd4022f0d

View File

@ -223,8 +223,6 @@ msleep(ident, mtx, priority, wmesg, timo)
mtx_assert(mtx, MA_OWNED | MA_NOTRECURSED);
WITNESS_SAVE(&mtx->mtx_object, mtx);
mtx_unlock(mtx);
if (priority & PDROP)
mtx = NULL;
}
/*
@ -280,7 +278,7 @@ msleep(ident, mtx, priority, wmesg, timo)
ktrcsw(0, 0);
#endif
PICKUP_GIANT();
if (mtx != NULL) {
if (mtx != NULL && !(priority & PDROP)) {
mtx_lock(mtx);
WITNESS_RESTORE(&mtx->mtx_object, mtx);
}