[v2,01/16] app/test: use previous value atomic fetch operations
Checks
Commit Message
Use __atomic_fetch_{add,and,or,sub,xor} instead of
__atomic_{add,and,or,sub,xor}_fetch adding the necessary code to
allow consumption of the resulting value.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
app/test/test_ring_perf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -186,7 +186,7 @@ struct thread_params {
void *burst = NULL;
#ifdef RTE_USE_C11_MEM_MODEL
- if (__atomic_add_fetch(&lcore_count, 1, __ATOMIC_RELAXED) != 2)
+ if (__atomic_fetch_add(&lcore_count, 1, __ATOMIC_RELAXED) + 1 != 2)
#else
if (__sync_add_and_fetch(&lcore_count, 1) != 2)
#endif