Fix a race between VBP_Remove() and vbp_thread()
Suppose the following happens: vbp_task() finishes with vt->running = 0 and a heap insert. The vbp_cond is signaled under the lock, but now instead of vbp_thread() waking up first, VBP_Remove() gets the lock and reaches assert(vt->heap_idx == VBH_NOIDX) before the racing vbp_thread() deleted the heap. This is unlikely to happen with static backends, because for those, the probe is stopped via the vcl temperature before they get removed. Fixes https://github.com/nigoroll/libvmod-dynamic/issues/100
Showing
Please register or sign in to comment