diff options
author | pjd <pjd@FreeBSD.org> | 2004-02-19 14:19:31 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2004-02-19 14:19:31 +0000 |
commit | 6bf691177644769542e2d645d4f91392a0493f2a (patch) | |
tree | c1e4a3f9362fea93ab685b1de070badfea9d87f9 /sys/kern | |
parent | 806650a364da6d56822814b83ebe8fb214bb1775 (diff) | |
download | FreeBSD-src-6bf691177644769542e2d645d4f91392a0493f2a.zip FreeBSD-src-6bf691177644769542e2d645d4f91392a0493f2a.tar.gz |
Simplify check. We are only able to check exclusive lock and if
2nd condition is true, first one is true for sure.
Approved by: jhb, scottl (mentor)
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_sx.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/kern/kern_sx.c b/sys/kern/kern_sx.c index e744f31..70b860c 100644 --- a/sys/kern/kern_sx.c +++ b/sys/kern/kern_sx.c @@ -348,8 +348,12 @@ _sx_assert(struct sx *sx, int what, const char *file, int line) #ifdef WITNESS witness_assert(&sx->sx_object, what, file, line); #else + /* + * We are able to check only exclusive lock here, + * we cannot assert that *this* thread owns slock. + */ mtx_lock(sx->sx_lock); - if (sx->sx_cnt != 0 && sx->sx_xholder == curthread) + if (sx->sx_xholder == curthread) printf("Lock %s locked @ %s:%d\n", sx->sx_object.lo_name, file, line); mtx_unlock(sx->sx_lock); |