[master] 812b13613 Ensure that only the rxthread gets to use h2->cond in h2_send_get
Dag Haavi Finstad
daghf at varnish-software.com
Wed Jun 27 11:41:12 UTC 2018
commit 812b136135eac0592d8d8f43d4e5511725d9579b
Author: Dag Haavi Finstad <daghf at varnish-software.com>
Date: Wed Jun 27 13:36:04 2018 +0200
Ensure that only the rxthread gets to use h2->cond in h2_send_get
Future-proofing to avoid mistakenly introducing another race down the
line.
diff --git a/bin/varnishd/http2/cache_http2_send.c b/bin/varnishd/http2/cache_http2_send.c
index 7c290bf9d..054796e4b 100644
--- a/bin/varnishd/http2/cache_http2_send.c
+++ b/bin/varnishd/http2/cache_http2_send.c
@@ -45,6 +45,8 @@ h2_send_get(struct worker *wrk, struct h2_sess *h2, struct h2_req *r2)
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
Lck_AssertHeld(&h2->sess->mtx);
+ if (&wrk->cond == h2->cond)
+ ASSERT_RXTHR(h2);
r2->wrk = wrk;
VTAILQ_INSERT_TAIL(&h2->txqueue, r2, tx_list);
while (VTAILQ_FIRST(&h2->txqueue) != r2)
More information about the varnish-commit
mailing list