r4168 - trunk/varnish-cache/bin/varnishd

sky at projects.linpro.no sky at projects.linpro.no
Fri Jul 31 11:18:52 CEST 2009


Author: sky
Date: 2009-07-31 11:18:52 +0200 (Fri, 31 Jul 2009)
New Revision: 4168

Modified:
   trunk/varnish-cache/bin/varnishd/cache_lck.c
Log:
pthread_mutex_trylock doesn't actually set errno

http://www.opengroup.org/onlinepubs/000095399/functions/pthread_mutex_lock.html

"The pthread_mutex_trylock() function shall return zero if a lock on the mutex object referenced by mutex is acquired. Otherwise, an error number is returned to indicate the error."



Modified: trunk/varnish-cache/bin/varnishd/cache_lck.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_lck.c	2009-07-31 09:12:55 UTC (rev 4167)
+++ trunk/varnish-cache/bin/varnishd/cache_lck.c	2009-07-31 09:18:52 UTC (rev 4168)
@@ -82,7 +82,7 @@
 		return;
 	}
 	r = pthread_mutex_trylock(&ilck->mtx);
-	assert(r == 0 || errno == EBUSY);
+	assert(r == 0 || r == EBUSY);
 	if (r) {
 		VSL(SLT_Debug, 0, "MTX_CONTEST(%s,%s,%d,%s)", p, f, l, ilck->w);
 		AZ(pthread_mutex_lock(&ilck->mtx));



More information about the varnish-commit mailing list