summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_sx.c
diff options
context:
space:
mode:
authorkmacy <kmacy@FreeBSD.org>2007-04-04 00:01:05 +0000
committerkmacy <kmacy@FreeBSD.org>2007-04-04 00:01:05 +0000
commitf66541917bf9a0bc9c64c4a3194e1951ac710f87 (patch)
tree51655869ba3051ec215b0ac0571f94a647cd77c2 /sys/kern/kern_sx.c
parent65266e0a565f6ae26e3401daf1853ca31292e88d (diff)
downloadFreeBSD-src-f66541917bf9a0bc9c64c4a3194e1951ac710f87.zip
FreeBSD-src-f66541917bf9a0bc9c64c4a3194e1951ac710f87.tar.gz
style fixes and make sure that the lock is treated as released in the sharers == 0 case
not that this is somewhat racy because a new sharer can come in while we're updating stats
Diffstat (limited to 'sys/kern/kern_sx.c')
-rw-r--r--sys/kern/kern_sx.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/kern/kern_sx.c b/sys/kern/kern_sx.c
index a988d0e..ad52af0 100644
--- a/sys/kern/kern_sx.c
+++ b/sys/kern/kern_sx.c
@@ -170,8 +170,7 @@ sx_init_flags(struct sx *sx, const char *description, int opts)
{
int flags;
- flags = LO_SLEEPABLE | LO_UPGRADABLE | LO_RECURSABLE;;
-
+ flags = LO_SLEEPABLE | LO_UPGRADABLE | LO_RECURSABLE;
if (opts & SX_DUPOK)
flags |= LO_DUPOK;
if (opts & SX_NOPROFILE)
@@ -274,6 +273,8 @@ _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(x) == 0)
+ lock_profile_release_lock(&sx->lock_object);
__sx_sunlock(sx, file, line);
}
@@ -522,9 +523,9 @@ _sx_xlock_hard(struct sx *sx, uintptr_t tid, const char *file, int line)
__func__, sx);
}
- GIANT_RESTORE();
+ GIANT_RESTORE();
lock_profile_obtain_lock_success(&(sx)->lock_object, contested,
- waitstart, (file), (line));
+ waitstart, file, line);
}
/*
OpenPOWER on IntegriCloud