From 442d21570deccad77ec07e08ba5abf874294f9aa Mon Sep 17 00:00:00 2001 From: phk Date: Mon, 25 Feb 2008 22:30:23 +0000 Subject: [PATCH] Avoid asserting on correct errno from pthread_mutextrylock() git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2539 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/cache.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/varnish-cache/bin/varnishd/cache.h b/varnish-cache/bin/varnishd/cache.h index e882dc9d..44bf5469 100644 --- a/varnish-cache/bin/varnishd/cache.h +++ b/varnish-cache/bin/varnishd/cache.h @@ -589,9 +589,7 @@ int RFC2616_cache_policy(const struct sess *sp, const struct http *hp); #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 @@ do { \ } 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 @@ do { \ } while (0) #define UNLOCK(foo) \ do { \ - errno = 0; \ AZ(pthread_mutex_unlock(foo)); \ if (params->diag_bitmap & 0x8) \ VSL(SLT_Debug, 0, \ -- 2.39.5