Explicitly document how we implicitly enforce the lock order of sleep

locks before spin locks.
This commit is contained in:
John Baldwin 2002-04-02 16:51:20 +00:00
parent 3eb933c093
commit 48c343df5f

View File

@ -474,6 +474,11 @@ witness_lock(struct lock_object *lock, int flags, const char *file, int line)
td = curthread;
if (class->lc_flags & LC_SLEEPLOCK) {
/*
* Since spin locks include a critical section, this check
* impliclty enforces a lock order of all sleep locks before
* all spin locks.
*/
if (td->td_critnest != 0 && (flags & LOP_TRYLOCK) == 0)
panic("blockable sleep lock (%s) %s @ %s:%d",
class->lc_name, lock->lo_name, file, line);