Commit 4fe8a9da authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Make sure we cache a consistent view of the workspace size.


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@1537 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent c00e7029
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment