[master] 2bbdf01 Make it more obvious which condtion fails.
Poul-Henning Kamp
phk at varnish-cache.org
Mon Aug 19 12:08:47 CEST 2013
commit 2bbdf01bf593d78c0f1bf0036a96eccb6e0d5a9d
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Mon Aug 19 09:29:41 2013 +0000
Make it more obvious which condtion fails.
diff --git a/bin/varnishd/cache/cache_lck.c b/bin/varnishd/cache/cache_lck.c
index 37fa115..4af926b 100644
--- a/bin/varnishd/cache/cache_lck.c
+++ b/bin/varnishd/cache/cache_lck.c
@@ -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__()
More information about the varnish-commit
mailing list