When "debug dev sched" is used to pop up background tasks, these tasks
are never stopped, so we must be careful to stop them when the stopping
flag is set, otherwise they can prevent the process from stopping when
sufficiently numerous (tests went as far as 100 million tasks, leading
the run queue never being completely purged in one poll round).
No backport is needed since this is only used when debugging and tuning
the scheduler.
unsigned long inter = tctx[1];
unsigned long rnd;
+ if (stopping)
+ return NULL;
+
t->expire = tick_add(now_ms, inter);
/* half of the calls will wake up another entry */
unsigned long rnd;
int i;
+ if (stopping)
+ return NULL;
+
/* wake up two random entries */
for (i = 0; i < 2; i++) {
rnd = statistical_prng() % tctx[0];