Commit 8fb66a8d authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Avoid the 10 second sleep while waiting for the VCL to appear.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4195 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent a3456767
...@@ -246,7 +246,6 @@ exp_timer(struct sess *sp, void *priv) ...@@ -246,7 +246,6 @@ exp_timer(struct sess *sp, void *priv)
struct objcore_head *lru; struct objcore_head *lru;
(void)priv; (void)priv;
AZ(sleep(10)); /* XXX: Takes time for VCL to arrive */
VCL_Get(&sp->vcl); VCL_Get(&sp->vcl);
t = TIM_real(); t = TIM_real();
while (1) { while (1) {
......
...@@ -84,6 +84,12 @@ VCL_Refresh(struct VCL_conf **vcc) ...@@ -84,6 +84,12 @@ VCL_Refresh(struct VCL_conf **vcc)
void void
VCL_Get(struct VCL_conf **vcc) VCL_Get(struct VCL_conf **vcc)
{ {
static int once;
while (!once && vcl_active == NULL) {
sleep(1);
}
once = 1;
Lck_Lock(&vcl_mtx); Lck_Lock(&vcl_mtx);
AN(vcl_active); AN(vcl_active);
......
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