Commit 744ced55 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

fix debug locks


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@1030 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent c02e1b8b
......@@ -445,6 +445,9 @@ int RFC2616_cache_policy(struct sess *sp, struct http *hp);
#define LOCK(foo) AZ(pthread_mutex_lock(foo))
#define UNLOCK(foo) AZ(pthread_mutex_unlock(foo))
#else
#define MTX pthread_mutex_t
#define MTX_INIT(foo) AZ(pthread_mutex_init(foo, NULL))
#define MTX_DESTROY(foo) AZ(pthread_mutex_destroy(foo))
#define LOCK(foo) \
do { \
if (pthread_mutex_trylock(foo)) { \
......@@ -452,17 +455,18 @@ do { \
"MTX_CONTEST(%s,%s,%d," #foo ")", \
__func__, __FILE__, __LINE__); \
AZ(pthread_mutex_lock(foo)); \
} else { \
} else if (1) { \
VSL(SLT_Debug, 0, \
"MTX_LOCK(%s,%s,%d," #foo ")", \
"MTX_LOCK(%s,%s,%d," #foo ")", \
__func__, __FILE__, __LINE__); \
} \
} while (0);
#define UNLOCK(foo) \
do { \
AZ(pthread_mutex_unlock(foo)); \
VSL(SLT_Debug, 0, \
"MTX_UNLOCK(%s,%s,%d," #foo ")", \
__func__, __FILE__, __LINE__); \
if (1) \
VSL(SLT_Debug, 0, \
"MTX_UNLOCK(%s,%s,%d," #foo ")", \
__func__, __FILE__, __LINE__); \
} while (0);
#endif
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