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);
98 while (success == 0) {
99 x = __atomic_load_n(&rwl->
cnt, __ATOMIC_RELAXED);
103 success = __atomic_compare_exchange_n(&rwl->
cnt, &x, x + 1, 1,
104 __ATOMIC_ACQUIRE, __ATOMIC_RELAXED);
119 __atomic_fetch_sub(&rwl->
cnt, 1, __ATOMIC_RELEASE);
141 x = __atomic_load_n(&rwl->
cnt, __ATOMIC_RELAXED);
142 if (x != 0 || __atomic_compare_exchange_n(&rwl->
cnt, &x, -1, 1,
143 __ATOMIC_ACQUIRE, __ATOMIC_RELAXED) == 0)
161 while (success == 0) {
162 x = __atomic_load_n(&rwl->
cnt, __ATOMIC_RELAXED);
168 success = __atomic_compare_exchange_n(&rwl->
cnt, &x, -1, 1,
169 __ATOMIC_ACQUIRE, __ATOMIC_RELAXED);
182 __atomic_store_n(&rwl->
cnt, 0, __ATOMIC_RELEASE);
static void rte_rwlock_write_lock_tm(rte_rwlock_t *rwl)
static void rte_rwlock_read_lock(rte_rwlock_t *rwl)
static void rte_rwlock_read_lock_tm(rte_rwlock_t *rwl)
static void rte_rwlock_read_unlock(rte_rwlock_t *rwl)
static void rte_pause(void)
static __rte_experimental int rte_rwlock_read_trylock(rte_rwlock_t *rwl)
static void rte_rwlock_write_unlock(rte_rwlock_t *rwl)
static void rte_rwlock_read_unlock_tm(rte_rwlock_t *rwl)
static void rte_rwlock_write_lock(rte_rwlock_t *rwl)
static void rte_rwlock_init(rte_rwlock_t *rwl)
static void rte_rwlock_write_unlock_tm(rte_rwlock_t *rwl)
static __rte_experimental int rte_rwlock_write_trylock(rte_rwlock_t *rwl)