[5.1] ad75b0e Add an assert so silly buggers who are to busy to check the arguments Lck_CondWait() will stopped in the tracks.

Poul-Henning Kamp phk at FreeBSD.org
Mon Apr 10 13:59:07 CEST 2017


commit ad75b0e43077b4c0be78729abf126646a8b361a9
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Mar 29 17:45:03 2017 +0000

    Add an assert so silly buggers who are to busy to check the arguments
    Lck_CondWait() will stopped in the tracks.

diff --git a/bin/varnishd/cache/cache_lck.c b/bin/varnishd/cache/cache_lck.c
index 4081d60..609971a 100644
--- a/bin/varnishd/cache/cache_lck.c
+++ b/bin/varnishd/cache/cache_lck.c
@@ -199,6 +199,7 @@ Lck_CondWait(pthread_cond_t *cond, struct lock *lck, double when)
 	if (when == 0) {
 		AZ(pthread_cond_wait(cond, &ilck->mtx));
 	} else {
+		assert(when > 1e9);
 		ts.tv_nsec = (long)(modf(when, &t) * 1e9);
 		ts.tv_sec = (long)t;
 		retval = pthread_cond_timedwait(cond, &ilck->mtx, &ts);



More information about the varnish-commit mailing list