MINOR: threads/atomic: rename local variables in macros to avoid conflicts

[ plock commit bfac5887ebabb8ef753b0351f162265767eb219b ]

Local variable "t" was renamed "__pl_t" to limit the risk of conflicts
with existing variables in application code.
This commit is contained in:
Willy Tarreau 2017-07-18 14:20:41 +02:00
parent eee5c39715
commit 98409e34ca
1 changed files with 4 additions and 4 deletions

View File

@ -499,10 +499,10 @@ static inline void pl_cpu_relax()
#define pl_sub(ptr, x) ({ __sync_sub_and_fetch((ptr), (x)); })
#define pl_xadd(ptr, x) ({ __sync_fetch_and_add((ptr), (x)); })
#define pl_cmpxchg(ptr, o, n) ({ __sync_val_compare_and_swap((ptr), (o), (n)); })
#define pl_xchg(ptr, x) ({ typeof(*(ptr)) t; \
do { t = *(ptr); \
} while (!__sync_bool_compare_and_swap((ptr), t, (x))); \
t; \
#define pl_xchg(ptr, x) ({ typeof(*(ptr)) __pl_t; \
do { __pl_t = *(ptr); \
} while (!__sync_bool_compare_and_swap((ptr), __pl_t, (x))); \
__pl_t; \
})
#endif