mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 22:01:31 +02:00
MEDIUM: queues: Use the new _HA_ATOMIC_* macros.
Use the new _HA_ATOMIC_* macros and add barriers where needed.
This commit is contained in:
parent
4051410fef
commit
b4df492d01
@ -141,7 +141,7 @@ static void __pendconn_unlink(struct pendconn *p)
|
|||||||
p->strm->logs.prx_queue_pos += p->px->queue_idx - p->queue_idx;
|
p->strm->logs.prx_queue_pos += p->px->queue_idx - p->queue_idx;
|
||||||
p->px->nbpend--;
|
p->px->nbpend--;
|
||||||
}
|
}
|
||||||
HA_ATOMIC_SUB(&p->px->totpend, 1);
|
_HA_ATOMIC_SUB(&p->px->totpend, 1);
|
||||||
eb32_delete(&p->node);
|
eb32_delete(&p->node);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -292,8 +292,9 @@ static int pendconn_process_next_strm(struct server *srv, struct proxy *px)
|
|||||||
else
|
else
|
||||||
px->queue_idx++;
|
px->queue_idx++;
|
||||||
|
|
||||||
HA_ATOMIC_ADD(&srv->served, 1);
|
_HA_ATOMIC_ADD(&srv->served, 1);
|
||||||
HA_ATOMIC_ADD(&srv->proxy->served, 1);
|
_HA_ATOMIC_ADD(&srv->proxy->served, 1);
|
||||||
|
__ha_barrier_atomic_store();
|
||||||
if (px->lbprm.server_take_conn)
|
if (px->lbprm.server_take_conn)
|
||||||
px->lbprm.server_take_conn(srv);
|
px->lbprm.server_take_conn(srv);
|
||||||
__stream_add_srv_conn(p->strm, srv);
|
__stream_add_srv_conn(p->strm, srv);
|
||||||
@ -385,7 +386,7 @@ struct pendconn *pendconn_add(struct stream *strm)
|
|||||||
|
|
||||||
pendconn_queue_unlock(p);
|
pendconn_queue_unlock(p);
|
||||||
|
|
||||||
HA_ATOMIC_ADD(&px->totpend, 1);
|
_HA_ATOMIC_ADD(&px->totpend, 1);
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user