Don't check witness assertions if the lock doesn't use witness or witness

is dead.
This commit is contained in:
John Baldwin 2001-06-28 22:22:20 +00:00
parent ed87274d16
commit ec178c1e4c

View File

@ -1351,6 +1351,9 @@ witness_assert(struct lock_object *lock, int flags, const char *file, int line)
#ifdef INVARIANT_SUPPORT
struct lock_instance *instance;
if (lock->lo_witness == NULL || witness_dead)
return;
if ((lock->lo_class->lc_flags & LC_SLEEPLOCK) != 0)
instance = find_instance(curproc->p_sleeplocks, lock);
else if ((lock->lo_class->lc_flags & LC_SPINLOCK) != 0)