From: Willy Tarreau Date: Fri, 6 Nov 2020 11:07:31 +0000 (+0100) Subject: MINOR: server: remove idle lock in srv_cleanup_connections X-Git-Tag: v2.4-dev1~72 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f5fe70620c9f9bdda5026e1f8b3673fe83257a7c;p=thirdparty%2Fhaproxy.git MINOR: server: remove idle lock in srv_cleanup_connections This function used to grab the idle lock when scanning the threads for idle connections, but it doesn't need it since the lock only protects the tree. Let's remove it. --- diff --git a/src/server.c b/src/server.c index 81f4e463ef..1e9f46ec72 100644 --- a/src/server.c +++ b/src/server.c @@ -5222,7 +5222,6 @@ static void srv_cleanup_connections(struct server *srv) int i; /* check all threads starting with ours */ - HA_SPIN_LOCK(OTHER_LOCK, &idle_conn_srv_lock); for (i = tid;;) { did_remove = 0; if (srv_migrate_conns_to_remove(&srv->idle_conns[i], &idle_conns[i].toremove_conns, -1) > 0) @@ -5235,7 +5234,6 @@ static void srv_cleanup_connections(struct server *srv) if ((i = ((i + 1 == global.nbthread) ? 0 : i + 1)) == tid) break; } - HA_SPIN_UNLOCK(OTHER_LOCK, &idle_conn_srv_lock); } struct task *srv_cleanup_idle_connections(struct task *task, void *context, unsigned short state)