MEDIUM: list: Use _HA_ATOMIC_*

Use _HA_ATOMIC_ instead of HA_ATOMIC_ because we know we don't need barriers.
This commit is contained in:
Olivier Houchard 2019-03-13 18:50:33 +01:00 committed by Olivier Houchard
parent 17fbb4eb3f
commit 9f8d821a55
1 changed files with 12 additions and 12 deletions

View File

@ -189,10 +189,10 @@ struct cond_wordlist {
while (1) { \
struct list *n; \
struct list *p; \
n = HA_ATOMIC_XCHG(&(lh)->n, LLIST_BUSY); \
n = _HA_ATOMIC_XCHG(&(lh)->n, LLIST_BUSY); \
if (n == LLIST_BUSY) \
continue; \
p = HA_ATOMIC_XCHG(&n->p, LLIST_BUSY); \
p = _HA_ATOMIC_XCHG(&n->p, LLIST_BUSY); \
if (p == LLIST_BUSY) { \
(lh)->n = n; \
__ha_barrier_store(); \
@ -214,10 +214,10 @@ struct cond_wordlist {
while (1) { \
struct list *n; \
struct list *p; \
p = HA_ATOMIC_XCHG(&(lh)->p, LLIST_BUSY); \
p = _HA_ATOMIC_XCHG(&(lh)->p, LLIST_BUSY); \
if (p == LLIST_BUSY) \
continue; \
n = HA_ATOMIC_XCHG(&p->n, LLIST_BUSY); \
n = _HA_ATOMIC_XCHG(&p->n, LLIST_BUSY); \
if (n == LLIST_BUSY) { \
(lh)->p = p; \
__ha_barrier_store(); \
@ -239,17 +239,17 @@ struct cond_wordlist {
while (1) { \
struct list *n, *n2; \
struct list *p, *p2 = NULL; \
n = HA_ATOMIC_XCHG(&(el)->n, LLIST_BUSY); \
n = _HA_ATOMIC_XCHG(&(el)->n, LLIST_BUSY); \
if (n == LLIST_BUSY) \
continue; \
p = HA_ATOMIC_XCHG(&(el)->p, LLIST_BUSY); \
p = _HA_ATOMIC_XCHG(&(el)->p, LLIST_BUSY); \
if (p == LLIST_BUSY) { \
(el)->n = n; \
__ha_barrier_store(); \
continue; \
} \
if (p != (el)) { \
p2 = HA_ATOMIC_XCHG(&p->n, LLIST_BUSY); \
p2 = _HA_ATOMIC_XCHG(&p->n, LLIST_BUSY); \
if (p2 == LLIST_BUSY) { \
(el)->p = p; \
(el)->n = n; \
@ -258,7 +258,7 @@ struct cond_wordlist {
} \
} \
if (n != (el)) { \
n2 = HA_ATOMIC_XCHG(&n->p, LLIST_BUSY); \
n2 = _HA_ATOMIC_XCHG(&n->p, LLIST_BUSY); \
if (n2 == LLIST_BUSY) { \
if (p2 != NULL) \
p->n = p2; \
@ -286,7 +286,7 @@ struct cond_wordlist {
while (1) { \
struct list *n, *n2; \
struct list *p, *p2; \
n = HA_ATOMIC_XCHG(&(lh)->n, LLIST_BUSY); \
n = _HA_ATOMIC_XCHG(&(lh)->n, LLIST_BUSY); \
if (n == LLIST_BUSY) \
continue; \
if (n == (lh)) { \
@ -295,13 +295,13 @@ struct cond_wordlist {
_ret = NULL; \
break; \
} \
p = HA_ATOMIC_XCHG(&n->p, LLIST_BUSY); \
p = _HA_ATOMIC_XCHG(&n->p, LLIST_BUSY); \
if (p == LLIST_BUSY) { \
(lh)->n = n; \
__ha_barrier_store(); \
continue; \
} \
n2 = HA_ATOMIC_XCHG(&n->n, LLIST_BUSY); \
n2 = _HA_ATOMIC_XCHG(&n->n, LLIST_BUSY); \
if (n2 == LLIST_BUSY) { \
n->p = p; \
__ha_barrier_store(); \
@ -309,7 +309,7 @@ struct cond_wordlist {
__ha_barrier_store(); \
continue; \
} \
p2 = HA_ATOMIC_XCHG(&n2->p, LLIST_BUSY); \
p2 = _HA_ATOMIC_XCHG(&n2->p, LLIST_BUSY); \
if (p2 == LLIST_BUSY) { \
n->n = n2; \
n->p = p; \