&service->idle_processes_tail, process);
DLLIST_PREPEND(&service->busy_processes, process);
process->idle_start = 0;
+
+ i_assert(service->process_idling > 0);
+ service->process_idling--;
}
process->total_count +=
process->available_count - status->available_count;
if (process->idle_start == 0) {
/* busy process started idling */
DLLIST_REMOVE(&service->busy_processes, process);
+ service->process_idling++;
} else {
/* Idling process updated its status again to be idling. Maybe
it was busy for a little bit? Update its idle_start time. */
service->process_count_total++;
service->process_count++;
service->process_avail++;
+ service->process_idling++;
DLLIST2_APPEND(&service->idle_processes_head,
&service->idle_processes_tail, process);
else {
DLLIST2_REMOVE(&service->idle_processes_head,
&service->idle_processes_tail, process);
+ i_assert(service->process_idling > 0);
+ service->process_idling--;
}
hash_table_remove(service_pids, POINTER_CAST(process->pid));
unsigned int process_count;
/* number of processes currently accepting new clients */
unsigned int process_avail;
+ /* number of processes currently idling (idle_start != 0) */
+ unsigned int process_idling;
/* max number of processes allowed */
unsigned int process_limit;
/* Total number of processes ever created */