CLEANUP: connections: rename the toremove_lock to takeover_lock
This lock was misnamed and a bit confusing. It's only used for takeover
so let's call it takeover_lock.
diff --git a/src/mux_h2.c b/src/mux_h2.c
index 0ad066b..adcc6c2 100644
--- a/src/mux_h2.c
+++ b/src/mux_h2.c
@@ -3524,13 +3524,13 @@
int ret = 0;
- HA_SPIN_LOCK(OTHER_LOCK, &idle_conns[tid].toremove_lock);
+ HA_SPIN_LOCK(OTHER_LOCK, &idle_conns[tid].takeover_lock);
if (t->context == NULL) {
/* The connection has been taken over by another thread,
* we're no longer responsible for it, so just free the
* tasklet, and do nothing.
*/
- HA_SPIN_UNLOCK(OTHER_LOCK, &idle_conns[tid].toremove_lock);
+ HA_SPIN_UNLOCK(OTHER_LOCK, &idle_conns[tid].takeover_lock);
tasklet_free(tl);
goto leave;
}
@@ -3547,7 +3547,7 @@
if (conn_in_list)
MT_LIST_DEL(&conn->list);
- HA_SPIN_UNLOCK(OTHER_LOCK, &idle_conns[tid].toremove_lock);
+ HA_SPIN_UNLOCK(OTHER_LOCK, &idle_conns[tid].takeover_lock);
if (!(h2c->wait_event.events & SUB_RETRY_SEND))
ret = h2_send(h2c);
@@ -3643,15 +3643,15 @@
}
/* connections in error must be removed from the idle lists */
- HA_SPIN_LOCK(OTHER_LOCK, &idle_conns[tid].toremove_lock);
+ HA_SPIN_LOCK(OTHER_LOCK, &idle_conns[tid].takeover_lock);
MT_LIST_DEL((struct mt_list *)&conn->list);
- HA_SPIN_UNLOCK(OTHER_LOCK, &idle_conns[tid].toremove_lock);
+ HA_SPIN_UNLOCK(OTHER_LOCK, &idle_conns[tid].takeover_lock);
}
else if (h2c->st0 == H2_CS_ERROR) {
/* connections in error must be removed from the idle lists */
- HA_SPIN_LOCK(OTHER_LOCK, &idle_conns[tid].toremove_lock);
+ HA_SPIN_LOCK(OTHER_LOCK, &idle_conns[tid].takeover_lock);
MT_LIST_DEL((struct mt_list *)&conn->list);
- HA_SPIN_UNLOCK(OTHER_LOCK, &idle_conns[tid].toremove_lock);
+ HA_SPIN_UNLOCK(OTHER_LOCK, &idle_conns[tid].takeover_lock);
}
if (!b_data(&h2c->dbuf))
@@ -3722,7 +3722,7 @@
/* We're about to destroy the connection, so make sure nobody attempts
* to steal it from us.
*/
- HA_SPIN_LOCK(OTHER_LOCK, &idle_conns[tid].toremove_lock);
+ HA_SPIN_LOCK(OTHER_LOCK, &idle_conns[tid].takeover_lock);
if (h2c->conn->flags & CO_FL_LIST_MASK)
MT_LIST_DEL(&h2c->conn->list);
@@ -3733,7 +3733,7 @@
if (!t->context)
h2c = NULL;
- HA_SPIN_UNLOCK(OTHER_LOCK, &idle_conns[tid].toremove_lock);
+ HA_SPIN_UNLOCK(OTHER_LOCK, &idle_conns[tid].takeover_lock);
}
task_destroy(t);
@@ -3780,9 +3780,9 @@
}
/* in any case this connection must not be considered idle anymore */
- HA_SPIN_LOCK(OTHER_LOCK, &idle_conns[tid].toremove_lock);
+ HA_SPIN_LOCK(OTHER_LOCK, &idle_conns[tid].takeover_lock);
MT_LIST_DEL((struct mt_list *)&h2c->conn->list);
- HA_SPIN_UNLOCK(OTHER_LOCK, &idle_conns[tid].toremove_lock);
+ HA_SPIN_UNLOCK(OTHER_LOCK, &idle_conns[tid].takeover_lock);
/* either we can release everything now or it will be done later once
* the last stream closes.