diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2008-02-13 23:33:50 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2008-02-13 23:33:50 +0000 |
| commit | 13c85a48dfca03f875f67afcfd4e4d2893105fad (patch) | |
| tree | 511e1ad3022734f5e06477f983809e3c3fa76105 /sys | |
| parent | 615fc0983c6a60e1a0e33dcd7f4793cf57821dc1 (diff) | |
Notes
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/kern/kern_mutex.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/kern/kern_mutex.c b/sys/kern/kern_mutex.c index 81be32d2bc6b..b770165fe888 100644 --- a/sys/kern/kern_mutex.c +++ b/sys/kern/kern_mutex.c @@ -485,7 +485,6 @@ _thread_lock_flags(struct thread *td, int opts, const char *file, int line) int i, contested; uint64_t waittime; - contested = i = 0; waittime = 0; tid = (uintptr_t)curthread; @@ -493,6 +492,11 @@ _thread_lock_flags(struct thread *td, int opts, const char *file, int line) retry: spinlock_enter(); m = td->td_lock; + KASSERT(m->mtx_lock != MTX_DESTROYED, + ("thread_lock() of destroyed mutex @ %s:%d", file, line)); + KASSERT(LOCK_CLASS(&m->lock_object) == &lock_class_mtx_spin, + ("thread_lock() of sleep mutex %s @ %s:%d", + m->lock_object.lo_name, file, line)); WITNESS_CHECKORDER(&m->lock_object, opts | LOP_NEWORDER | LOP_EXCLUSIVE, file, line); while (!_obtain_lock(m, tid)) { @@ -525,6 +529,8 @@ retry: if (m->mtx_recurse == 0) lock_profile_obtain_lock_success(&m->lock_object, contested, waittime, (file), (line)); + LOCK_LOG_LOCK("LOCK", &m->lock_object, opts, m->mtx_recurse, file, + line); WITNESS_LOCK(&m->lock_object, opts | LOP_EXCLUSIVE, file, line); } |
