MEDIUM: servers: Used a locked list for idle_orphan_conns.

Use the locked macros when manipulating idle_orphan_conns, so that other
threads can remove elements from it.
It will be useful later to avoid having a task per server and per thread to
cleanup the orphan list.
This commit is contained in:
Olivier Houchard
2019-01-22 16:11:03 +01:00
committed by Olivier Houchard
parent a8434ec146
commit 7f1bc31fee
3 changed files with 7 additions and 5 deletions

View File

@@ -698,7 +698,7 @@ static inline void conn_free(struct connection *conn)
}
conn_force_unsubscribe(conn);
LIST_DEL(&conn->list);
LIST_DEL_LOCKED(&conn->list);
LIST_INIT(&conn->list);
pool_free(pool_head_connection, conn);
}

View File

@@ -252,7 +252,7 @@ static inline int srv_add_to_idle_list(struct server *srv, struct connection *co
return 0;
}
LIST_DEL(&conn->list);
LIST_ADDQ(&srv->idle_orphan_conns[tid], &conn->list);
LIST_ADDQ_LOCKED(&srv->idle_orphan_conns[tid], &conn->list);
srv->curr_idle_thr[tid]++;
conn->idle_time = now_ms;