]> err.no Git - varnish/commitdiff
Avoid asserting on correct errno from pthread_mutextrylock()
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 25 Feb 2008 22:30:23 +0000 (22:30 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 25 Feb 2008 22:30:23 +0000 (22:30 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2539 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache.h

index e882dc9d686eb75c815390f2834c1a1cfd6e1388..44bf54693d9c139736f5b356e9bfbd4d3c431f6b 100644 (file)
@@ -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,                               \