]> err.no Git - varnish/commitdiff
Make sure we cache a consistent view of the workspace size.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sun, 24 Jun 2007 09:40:09 +0000 (09:40 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sun, 24 Jun 2007 09:40:09 +0000 (09:40 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1537 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_session.c

index 96f871ea49d0b04ee480356d07aa963b60c812da..2ca9efbf5d5acc07edfa2cdf1136fb48fcc49e47 100644 (file)
@@ -255,8 +255,7 @@ struct sess *
 SES_New(struct sockaddr *addr, unsigned len)
 {
        struct sessmem *sm;
-       unsigned u;
-
+       volatile unsigned u;
 
        /*
         * One of the two queues is unlocked because only one
@@ -279,6 +278,10 @@ SES_New(struct sockaddr *addr, unsigned len)
        } else {
                /*
                 * If that fails, alloc new one.
+                *
+                * It is not necessary to lock mem_workspace, but we
+                * need to cache it locally, to make sure we get a
+                * consistent view of it.
                 */
                u = params->mem_workspace;
                sm = malloc(sizeof *sm + u);