Add a pointer to the server into the struct srv_per_tgroup, so that if
we only have access to that srv_per_tgroup, we can come back to the
corresponding server.
/* Each server will have one occurrence of this structure per thread group */
struct srv_per_tgroup {
struct queue queue; /* pending connections */
+ struct server *server; /* pointer to the corresponding server */
unsigned int last_other_tgrp_served; /* Last other tgrp we dequeued from */
unsigned int self_served; /* Number of connection we dequeued from our own queue */
unsigned int dequeuing; /* non-zero = dequeuing in progress (atomic) */
LIST_INIT(&srv->per_thr[i].idle_conn_list);
}
- for (i = 0; i < global.nbtgroups; i++)
+ for (i = 0; i < global.nbtgroups; i++) {
+ srv->per_tgrp[i].server = srv;
queue_init(&srv->per_tgrp[i].queue, srv->proxy, srv);
+ }
return 0;
}