Commit 85e79d06 authored by Dridi Boukelmoune's avatar Dridi Boukelmoune

varnishtest: Remove critical section

The buf_len field is only ever modified by the poll thread and should not
need to be guarded here. This will hopefully silence a coverity warning:

   CID 1485138:  Concurrent data access violations  (ATOMICITY)
   Using an unreliable value of "l" inside the second locked
   section. If the data that "l" depends on was changed by
   another thread, this use might be incorrect.

It might on the other hand complain even harder, I have an alternative
if that happens.
parent f00f23d8
......@@ -345,9 +345,7 @@ tunnel_write(struct tunnel *t, struct vtclog *vl, struct tunnel_lane *lane,
ssize_t res, l;
p = lane->buf;
AZ(pthread_mutex_lock(&t->mtx));
l = lane->buf_len;
AZ(pthread_mutex_unlock(&t->mtx));
if (l > 0)
vtc_log(vl, 3, "%s %zd bytes", action, l);
......
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