| 1278 | agent_publish(w, heap, (size_t)n); |
| 1279 | free(heap); |
| 1280 | } |
| 1281 | |
| 1282 | static bool worker_is_idle(agent_worker *w); |
| 1283 | |
| 1284 | static void agent_set_status(agent_worker *w, agent_worker_state state) { |
| 1285 | pthread_mutex_lock(&w->mu); |
| 1286 | w->status.state = state; |
| 1287 | if (state != AGENT_WORKER_PREFILL) |
| 1288 | w->status.prefill_tps = 0.0; |
| 1289 | if (state != AGENT_WORKER_GENERATING) |
| 1290 | w->status.greedy_sampling = false; |
| 1291 | agent_wake_locked(w); |
no test coverage detected