aboutsummaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorAttilio Rao <attilio@FreeBSD.org>2007-05-29 19:34:32 +0000
committerAttilio Rao <attilio@FreeBSD.org>2007-05-29 19:34:32 +0000
commitacf840c4bda2466fdc7d001d3c664f97572130e3 (patch)
tree2373876efc7dbb5fe5091c1e3f67cf38a5f35ea5 /sys/kern
parenta99f0a465391f4259d11499ad41a847a0be98f0f (diff)
downloadsrc-acf840c4bda2466fdc7d001d3c664f97572130e3.tar.gz
src-acf840c4bda2466fdc7d001d3c664f97572130e3.zip
Add a small fix for lock profiling in sx locks.
"0" cannot be a correct value since when the function is entered at least one shared holder must be present and since we want the last one "1" is the correct value. Note that lock_profiling for sx locks is far from being perfect. Expect further fixes for that. Approved by: jeff (mentor)
Notes
Notes: svn path=/head/; revision=170113
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_sx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/kern_sx.c b/sys/kern/kern_sx.c
index ea7d03641cb3..2a25fdcbe0fd 100644
--- a/sys/kern/kern_sx.c
+++ b/sys/kern/kern_sx.c
@@ -277,7 +277,7 @@ _sx_sunlock(struct sx *sx, const char *file, int line)
curthread->td_locks--;
WITNESS_UNLOCK(&sx->lock_object, 0, file, line);
LOCK_LOG_LOCK("SUNLOCK", &sx->lock_object, 0, 0, file, line);
- if (SX_SHARERS(sx->sx_lock) == 0)
+ if (SX_SHARERS(sx->sx_lock) == 1)
lock_profile_release_lock(&sx->lock_object);
__sx_sunlock(sx, file, line);
}