summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authortanimura <tanimura@FreeBSD.org>2002-01-18 09:21:15 +0000
committertanimura <tanimura@FreeBSD.org>2002-01-18 09:21:15 +0000
commitd254e724006714f3f20b2ea58624a58cc97d2874 (patch)
tree1009e9564896385150b57b0adfc66339f5243b99 /sys/kern
parent677e0da5fb33f62e89a7a84a694ac8bc6e58fb4e (diff)
downloadFreeBSD-src-d254e724006714f3f20b2ea58624a58cc97d2874.zip
FreeBSD-src-d254e724006714f3f20b2ea58624a58cc97d2874.tar.gz
Invert the test of sx_xholder for SX_LOCKED. We need to warn if a
thread other than the curthread holds an sx. While I am here, break a line at the end of warning.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_sx.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_sx.c b/sys/kern/kern_sx.c
index 38136a1..dda9fe7 100644
--- a/sys/kern/kern_sx.c
+++ b/sys/kern/kern_sx.c
@@ -318,8 +318,8 @@ _sx_assert(struct sx *sx, int what, const char *file, int line)
#else
mtx_lock(sx->sx_lock);
if (sx->sx_cnt <= 0 &&
- (what == SX_SLOCKED || sx->sx_xholder == curthread))
- printf("Lock %s not %slocked @ %s:%d",
+ (what == SX_SLOCKED || sx->sx_xholder != curthread))
+ printf("Lock %s not %slocked @ %s:%d\n",
sx->sx_object.lo_name, (what == SX_SLOCKED) ?
"share " : "", file, line);
mtx_unlock(sx->sx_lock);
@@ -328,7 +328,7 @@ _sx_assert(struct sx *sx, int what, const char *file, int line)
case SX_XLOCKED:
mtx_lock(sx->sx_lock);
if (sx->sx_xholder != curthread)
- printf("Lock %s not exclusively locked @ %s:%d",
+ printf("Lock %s not exclusively locked @ %s:%d\n",
sx->sx_object.lo_name, file, line);
mtx_unlock(sx->sx_lock);
break;
OpenPOWER on IntegriCloud