MEDIUM: queues: Use the new _HA_ATOMIC_* macros.
Use the new _HA_ATOMIC_* macros and add barriers where needed.
diff --git a/src/queue.c b/src/queue.c
index e0be7a2..e4703df 100644
--- a/src/queue.c
+++ b/src/queue.c
@@ -141,7 +141,7 @@
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 @@
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 @@
pendconn_queue_unlock(p);
- HA_ATOMIC_ADD(&px->totpend, 1);
+ _HA_ATOMIC_ADD(&px->totpend, 1);
return p;
}