diff options
| author | Attilio Rao <attilio@FreeBSD.org> | 2007-12-27 22:56:57 +0000 |
|---|---|---|
| committer | Attilio Rao <attilio@FreeBSD.org> | 2007-12-27 22:56:57 +0000 |
| commit | 7a1d78fa3fdb41351a3fd279db86039886db232e (patch) | |
| tree | 864827637835381b82a08d4fb02140a628f2f208 /sys/kern/kern_lock.c | |
| parent | 0417fe5421be43b36463a294f8cd62d4fcf799d1 (diff) | |
Notes
Diffstat (limited to 'sys/kern/kern_lock.c')
| -rw-r--r-- | sys/kern/kern_lock.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c index 3e1d78fe4887..d4413def1baf 100644 --- a/sys/kern/kern_lock.c +++ b/sys/kern/kern_lock.c @@ -198,7 +198,15 @@ _lockmgr(struct lock *lkp, u_int flags, struct mtx *interlkp, int extflags, lockflags; int contested = 0; uint64_t waitstart = 0; - + + /* + * Lock owner can only be curthread or, at least, NULL in order to + * have a deadlock free implementation of the primitive. + */ + KASSERT(td == NULL || td == curthread, + ("lockmgr: owner thread (%p) cannot differ from curthread or NULL", + td)); + error = 0; if (td == NULL) thr = LK_KERNPROC; |
