Commit 2fdd6821 authored by Federico G. Schwindt's avatar Federico G. Schwindt Committed by Pål Hermunn Johansen

Set the task arguments under the lock

I've been torturing varnish with this change for some time and was
not able to reproduce the problem.

Should fix #2719.
parent 24f57e04
......@@ -222,13 +222,12 @@ Pool_Task_Arg(struct worker *wrk, enum task_prio how, task_func_t *func,
wrk2 = wrk;
retval = 0;
}
Lck_Unlock(&pp->mtx);
AZ(wrk2->task.func);
assert(arg_len <= WS_Reserve(wrk2->aws, arg_len));
memcpy(wrk2->aws->f, arg, arg_len);
wrk2->task.func = func;
wrk2->task.priv = wrk2->aws->f;
Lck_Unlock(&pp->mtx);
if (retval)
AZ(pthread_cond_signal(&wrk2->cond));
return (retval);
......
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