Commit 2cba061d authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Don't increment the contested counter until we have the lock.

parent f7d1c8bf
......@@ -114,14 +114,13 @@ Lck__Lock(struct lock *lck, const char *p, int l)
Lck_Witness_Lock(ilck, p, l, "");
if (DO_DEBUG(DBG_LCK)) {
r = pthread_mutex_trylock(&ilck->mtx);
if (r == EBUSY)
ilck->stat->dbg_busy++;
else
AZ(r);
assert(r == 0 || r == EBUSY);
}
if (r)
AZ(pthread_mutex_lock(&ilck->mtx));
AZ(ilck->held);
if (r == EBUSY)
ilck->stat->dbg_busy++;
ilck->stat->locks++;
ilck->owner = pthread_self();
ilck->held = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment