Mailing List Archive

r2539 - trunk/varnish-cache/bin/varnishd
Author: phk
Date: 2008-02-25 23:30:23 +0100 (Mon, 25 Feb 2008)
New Revision: 2539

Modified:
trunk/varnish-cache/bin/varnishd/cache.h
Log:
Avoid asserting on correct errno from pthread_mutextrylock()


Modified: trunk/varnish-cache/bin/varnishd/cache.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache.h 2008-02-25 18:42:07 UTC (rev 2538)
+++ trunk/varnish-cache/bin/varnishd/cache.h 2008-02-25 22:30:23 UTC (rev 2539)
@@ -589,9 +589,7 @@
#define MTX_DESTROY(foo) AZ(pthread_mutex_destroy(foo))
#define TRYLOCK(foo, r) \
do { \
- errno = 0; \
(r) = pthread_mutex_trylock(foo); \
- assert((r) == 0 || errno == EBUSY); \
if (params->diag_bitmap & 0x8) { \
VSL(SLT_Debug, 0, \
"MTX_TRYLOCK(%s,%s,%d," #foo ") = %d", \
@@ -600,7 +598,6 @@
} while (0)
#define LOCK(foo) \
do { \
- errno = 0; \
if (!(params->diag_bitmap & 0x18)) { \
AZ(pthread_mutex_lock(foo)); \
} else if (pthread_mutex_trylock(foo)) { \
@@ -616,7 +613,6 @@
} while (0)
#define UNLOCK(foo) \
do { \
- errno = 0; \
AZ(pthread_mutex_unlock(foo)); \
if (params->diag_bitmap & 0x8) \
VSL(SLT_Debug, 0, \