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.
diff --git a/include/proto/connection.h b/include/proto/connection.h
index 45b8a8a..3bfad58 100644
--- a/include/proto/connection.h
+++ b/include/proto/connection.h
@@ -698,7 +698,7 @@
}
conn_force_unsubscribe(conn);
- LIST_DEL(&conn->list);
+ LIST_DEL_LOCKED(&conn->list);
LIST_INIT(&conn->list);
pool_free(pool_head_connection, conn);
}
diff --git a/include/proto/server.h b/include/proto/server.h
index 9467f69..82c9cbf 100644
--- a/include/proto/server.h
+++ b/include/proto/server.h
@@ -252,7 +252,7 @@
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;