Commit 8bf63a88 authored by Martin Blix Grydeland's avatar Martin Blix Grydeland Committed by Reza Naghibi

Correct the probe heap comparison function

Fix the probe scheduler heap comparison function to be consistent with
regard to different running state of the two arguments. With this fix,
probes that are not running will always bubble to the top before those
that are already running.
parent ef20272c
...@@ -696,8 +696,8 @@ vbp_cmp(void *priv, const void *a, const void *b) ...@@ -696,8 +696,8 @@ vbp_cmp(void *priv, const void *a, const void *b)
CAST_OBJ_NOTNULL(aa, a, VBP_TARGET_MAGIC); CAST_OBJ_NOTNULL(aa, a, VBP_TARGET_MAGIC);
CAST_OBJ_NOTNULL(bb, b, VBP_TARGET_MAGIC); CAST_OBJ_NOTNULL(bb, b, VBP_TARGET_MAGIC);
if (aa->running && !bb->running) if ((aa->running == 0) != (bb->running == 0))
return (0); return (aa->running == 0);
return (aa->due < bb->due); return (aa->due < bb->due);
} }
......
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