MEDIUM: list: Separate "locked" list from regular list.

Instead of using the same type for regular linked lists and "autolocked"
linked lists, use a separate type, "struct mt_list", for the autolocked one,
and introduce a set of macros, similar to the LIST_* macros, with the
MT_ prefix.
When we use the same entry for both regular list and autolocked list, as
is done for the "list" field in struct connection, we know have to explicitely
cast it to struct mt_list when using MT_ macros.
diff --git a/include/proto/connection.h b/include/proto/connection.h
index b1d8638..a7647bd 100644
--- a/include/proto/connection.h
+++ b/include/proto/connection.h
@@ -625,7 +625,7 @@
 
 	conn_force_unsubscribe(conn);
 	HA_SPIN_LOCK(OTHER_LOCK, &toremove_lock[tid]);
-	LIST_DEL_LOCKED(&conn->list);
+	MT_LIST_DEL((struct mt_list *)&conn->list);
 	HA_SPIN_UNLOCK(OTHER_LOCK, &toremove_lock[tid]);
 	pool_free(pool_head_connection, conn);
 }
diff --git a/include/proto/listener.h b/include/proto/listener.h
index 24a01b2..b245d6e 100644
--- a/include/proto/listener.h
+++ b/include/proto/listener.h
@@ -58,7 +58,7 @@
 int disable_all_listeners(struct protocol *proto);
 
 /* Dequeues all of the listeners waiting for a resource in wait queue <queue>. */
-void dequeue_all_listeners(struct list *list);
+void dequeue_all_listeners(struct mt_list *list);
 
 /* Must be called with the lock held. Depending on <do_close> value, it does
  * what unbind_listener or unbind_listener_no_close should do.
diff --git a/include/proto/server.h b/include/proto/server.h
index f52b38e..5a2fcc9 100644
--- a/include/proto/server.h
+++ b/include/proto/server.h
@@ -41,7 +41,7 @@
 extern struct eb_root idle_conn_srv;
 extern struct task *idle_conn_task;
 extern struct task *idle_conn_cleanup[MAX_THREADS];
-extern struct list toremove_connections[MAX_THREADS];
+extern struct mt_list toremove_connections[MAX_THREADS];
 
 int srv_downtime(const struct server *s);
 int srv_lastsession(const struct server *s);
@@ -262,7 +262,7 @@
 			return 0;
 		}
 		LIST_DEL(&conn->list);
-		LIST_ADDQ_LOCKED(&srv->idle_orphan_conns[tid], &conn->list);
+		MT_LIST_ADDQ(&srv->idle_orphan_conns[tid], (struct mt_list *)&conn->list);
 		srv->curr_idle_thr[tid]++;
 
 		conn->idle_time = now_ms;
diff --git a/include/proto/task.h b/include/proto/task.h
index 4044bd4..f213f47 100644
--- a/include/proto/task.h
+++ b/include/proto/task.h
@@ -542,9 +542,9 @@
 }
 
 /* adds list item <item> to work list <work> and wake up the associated task */
-static inline void work_list_add(struct work_list *work, struct list *item)
+static inline void work_list_add(struct work_list *work, struct mt_list *item)
 {
-	LIST_ADDQ_LOCKED(&work->head, item);
+	MT_LIST_ADDQ(&work->head, item);
 	task_wakeup(work->task, TASK_WOKEN_OTHER);
 }