/* simply removes a server from a tree.
*
- * The server's lock and the lbprm's lock must be held.
+ * The lbprm's lock must be held.
*/
static inline void fas_dequeue_srv(struct server *s)
{
* reached. It is important to understand that the server weight is not used
* here.
*
- * The server's lock and the lbprm's lock must be held.
+ * The lbprm's lock must be held.
*/
static inline void fas_queue_srv(struct server *s)
{
*/
static void fas_srv_reposition(struct server *s, int locked)
{
- if (!locked)
- HA_SPIN_LOCK(SERVER_LOCK, &s->lock);
-
HA_RWLOCK_WRLOCK(LBPRM_LOCK, &s->proxy->lbprm.lock);
if (s->lb_tree) {
fas_dequeue_srv(s);
fas_queue_srv(s);
}
HA_RWLOCK_WRUNLOCK(LBPRM_LOCK, &s->proxy->lbprm.lock);
-
- if (!locked)
- HA_SPIN_UNLOCK(SERVER_LOCK, &s->lock);
}
/* This function updates the server trees according to server <srv>'s new