]> err.no Git - varnish/commitdiff
Minimal intervention fix for #162: we can delay arming a kevent, but we
authordes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 8 Nov 2007 20:30:06 +0000 (20:30 +0000)
committerdes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 8 Nov 2007 20:30:06 +0000 (20:30 +0000)
can't delay disarming it, or we will have a race between the acceptor and
a worker thread.  This will need revisiting at some later date.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2232 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_acceptor_kqueue.c

index 800bc102b3ed6abf11115a0ae079cf95ecc1714d..54631a3a731adf3e599b43daea0282bc4ed9d6a1 100644 (file)
@@ -66,8 +66,8 @@ vca_kq_sess(struct sess *sp, short arm)
        if (sp->fd < 0)
                return;
        EV_SET(&ki[nki], sp->fd, EVFILT_READ, arm, 0, 0, sp);
-       if (++nki == NKEV) {
-               assert(kevent(kq, ki, nki, NULL, 0, NULL) <= 0);
+       if (++nki == NKEV || arm == EV_DELETE) {
+               AZ(kevent(kq, ki, nki, NULL, 0, NULL));
                nki = 0;
        }
 }