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)
This commit is contained in:
Attilio Rao 2007-05-29 19:34:32 +00:00
parent a99f0a4653
commit acf840c4bd

View File

@ -277,7 +277,7 @@ _sx_sunlock(struct sx *sx, const char *file, int line)
curthread->td_locks--; curthread->td_locks--;
WITNESS_UNLOCK(&sx->lock_object, 0, file, line); WITNESS_UNLOCK(&sx->lock_object, 0, file, line);
LOCK_LOG_LOCK("SUNLOCK", &sx->lock_object, 0, 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); lock_profile_release_lock(&sx->lock_object);
__sx_sunlock(sx, file, line); __sx_sunlock(sx, file, line);
} }