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

Make it more obvious which condtion fails.

parent 0e46b160
......@@ -128,13 +128,14 @@ Lck__Assert(const struct lock *lck, int held)
{
struct ilck *ilck;
CAST_OBJ_NOTNULL(ilck, lck->priv, ILCK_MAGIC);
if (held)
assert(ilck->held &&
pthread_equal(ilck->owner, pthread_self()));
else
assert(!ilck->held ||
!pthread_equal(ilck->owner, pthread_self()));
CAST_OBJ_NOTNULL(ilck, lck->priv, ILCK_MAGIC);
if (held) {
assert(ilck->held);
assert(pthread_equal(ilck->owner, pthread_self()));
} else {
assert(!ilck->held);
assert(!pthread_equal(ilck->owner, pthread_self()));
}
}
int __match_proto__()
......
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