40 #define RTE_RWLOCK_INITIALIZER { 0 }
66 while (success == 0) {
67 x = __atomic_load_n(&rwl->
cnt, __ATOMIC_RELAXED);
73 success = __atomic_compare_exchange_n(&rwl->
cnt, &x, x + 1, 1,
74 __ATOMIC_ACQUIRE, __ATOMIC_RELAXED);
91 static inline __rte_experimental
int
97 while (success == 0) {
98 x = __atomic_load_n(&rwl->
cnt, __ATOMIC_RELAXED);
102 success = __atomic_compare_exchange_n(&rwl->
cnt, &x, x + 1, 1,
103 __ATOMIC_ACQUIRE, __ATOMIC_RELAXED);
118 __atomic_fetch_sub(&rwl->
cnt, 1, __ATOMIC_RELEASE);
134 static inline __rte_experimental
int
139 x = __atomic_load_n(&rwl->
cnt, __ATOMIC_RELAXED);
140 if (x != 0 || __atomic_compare_exchange_n(&rwl->
cnt, &x, -1, 1,
141 __ATOMIC_ACQUIRE, __ATOMIC_RELAXED) == 0)
159 while (success == 0) {
160 x = __atomic_load_n(&rwl->
cnt, __ATOMIC_RELAXED);
166 success = __atomic_compare_exchange_n(&rwl->
cnt, &x, -1, 1,
167 __ATOMIC_ACQUIRE, __ATOMIC_RELAXED);
180 __atomic_store_n(&rwl->
cnt, 0, __ATOMIC_RELEASE);