Skip to content

Commit

Permalink
make VBP_Control behave based on the current state
Browse files Browse the repository at this point in the history
v00003.vtc exposes some situation which I have not yet fully understood,
but it seems that VBP_Control should only act if anything needs to be
done.
  • Loading branch information
nigoroll committed Jun 28, 2018
1 parent 81f519a commit 787cb78
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions bin/varnishd/cache/cache_backend_probe.c
Expand Up @@ -641,12 +641,12 @@ VBP_Control(const struct backend *be, int enable)

Lck_Lock(&vbp_mtx);
if (enable) {
assert(vt->heap_idx == BINHEAP_NOIDX);
vt->due = VTIM_real();
binheap_insert(vbp_heap, vt);
AZ(pthread_cond_signal(&vbp_cond));
} else {
assert(vt->heap_idx != BINHEAP_NOIDX);
if (vt->heap_idx == BINHEAP_NOIDX) {
vt->due = VTIM_real();
binheap_insert(vbp_heap, vt);
AZ(pthread_cond_signal(&vbp_cond));
}
} else if (vt->heap_idx != BINHEAP_NOIDX) {
binheap_delete(vbp_heap, vt->heap_idx);
}
Lck_Unlock(&vbp_mtx);
Expand Down

0 comments on commit 787cb78

Please sign in to comment.