mirror of
http://git.haproxy.org/git/haproxy.git
synced 2026-02-10 02:22:34 +02:00
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:
committed by
Olivier Houchard
parent
a8434ec146
commit
7f1bc31fee
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user