Router: more logical code order change.
Updating the router engines list before posting jobs to worker thread
engines is more logical because worker threads may exit after the posting.
However, the previous code was safe because an engine is freed by
the router main thread after worker its thread has exited.
@@ -1548,8 +1548,6 @@ nxt_router_engines_post(nxt_router_t *router, nxt_router_temp_conf_t *tmcf)
for (n = tmcf->engines->nelts; n != 0; n--) {
engine = recf->engine;
- nxt_router_engine_post(engine, recf->jobs);
-
switch (recf->action) {
case NXT_ROUTER_ENGINE_KEEP:
@@ -1564,6 +1562,8 @@ nxt_router_engines_post(nxt_router_t *router, nxt_router_temp_conf_t *tmcf)
break;
}
+ nxt_router_engine_post(engine, recf->jobs);
+
recf++;
}
}
