Follow-up for
52e3671bf7e6321c58c6d3a6c8ad8e167259a569
unit_gc_sweep() might try to add the unit to gc queue again.
While that becomes no-op as Unit.in_gc_queue is not cleared
yet, it induces minor inconsistency of states.
static unsigned manager_dispatch_gc_unit_queue(Manager *m) {
unsigned n = 0, gc_marker;
- Unit *u;
assert(m);
gc_marker = m->gc_marker;
- while ((u = LIST_POP(gc_queue, m->gc_unit_queue))) {
+ Unit *u;
+ while ((u = m->gc_unit_queue)) {
assert(u->in_gc_queue);
unit_gc_sweep(u, gc_marker);
+ LIST_REMOVE(gc_queue, m->gc_unit_queue, u);
u->in_gc_queue = false;
n++;