Reduce SHM mutex contention further, by only holding lock over
reservation of space, and do the copying from workthread buffer
to shm buffer efter we let go of the mutex.
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2590
d4fa192b-c00b-0410-8231-
f00ffab90ce4
if (loghead->ptr + l + 1 >= loghead->size)
vsl_wrap();
p = logstart + loghead->ptr;
- memcpy(p + 1, w->wlb + 1, l - 1);
p[l] = SLT_ENDMARKER;
loghead->ptr += l;
assert(loghead->ptr < loghead->size);
+ UNLOCKSHM(&vsl_mtx);
+ memcpy(p + 1, w->wlb + 1, l - 1);
/* XXX: memory barrier here */
p[0] = w->wlb[0];
- UNLOCKSHM(&vsl_mtx);
w->wlp = w->wlb;
w->wlr = 0;
}