From b4df492d01501c5661e69644b571d5531bbb4ca1 Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Fri, 8 Mar 2019 18:54:16 +0100 Subject: [PATCH] MEDIUM: queues: Use the new _HA_ATOMIC_* macros. Use the new _HA_ATOMIC_* macros and add barriers where needed. --- src/queue.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/queue.c b/src/queue.c index e0be7a292..e4703df6a 100644 --- a/src/queue.c +++ b/src/queue.c @@ -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->px->nbpend--; } - HA_ATOMIC_SUB(&p->px->totpend, 1); + _HA_ATOMIC_SUB(&p->px->totpend, 1); eb32_delete(&p->node); } @@ -292,8 +292,9 @@ static int pendconn_process_next_strm(struct server *srv, struct proxy *px) else px->queue_idx++; - HA_ATOMIC_ADD(&srv->served, 1); - HA_ATOMIC_ADD(&srv->proxy->served, 1); + _HA_ATOMIC_ADD(&srv->served, 1); + _HA_ATOMIC_ADD(&srv->proxy->served, 1); + __ha_barrier_atomic_store(); if (px->lbprm.server_take_conn) px->lbprm.server_take_conn(srv); __stream_add_srv_conn(p->strm, srv); @@ -385,7 +386,7 @@ struct pendconn *pendconn_add(struct stream *strm) pendconn_queue_unlock(p); - HA_ATOMIC_ADD(&px->totpend, 1); + _HA_ATOMIC_ADD(&px->totpend, 1); return p; }