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
This commit is contained in:
Kip Macy 2007-04-04 00:01:05 +00:00
parent 41948c2530
commit e2bc106690
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=168332

View File

@ -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);
}
/*