[dpdk-dev] [PATCH v3 1/3] rwlock: reimplement with atomic builtins
Stephen Hemminger
stephen at networkplumber.org
Thu Mar 14 16:54:29 CET 2019
On Thu, 14 Mar 2019 21:15:02 +0800
Joyce Kong <joyce.kong at arm.com> wrote:
> - success = rte_atomic32_cmpset((volatile uint32_t *)&rwl->cnt,
> - (uint32_t)x, (uint32_t)(x + 1));
> + success = __atomic_compare_exchange_n(&rwl->cnt, &x, x+1, 1,
> + __ATOMIC_ACQUIRE, __ATOMIC_RELAXED);
Would it be possible to have rte_atomic32_cmpset be an inline function
that became __atomic_comppare_exchange? Then all usages would be the same.
More information about the dev
mailing list