23 #include <cne_pause.h>
41 #define CNE_RWLOCK_INITIALIZER \
70 while (success == 0) {
71 x = __atomic_load_n(&rwl->
cnt, __ATOMIC_RELAXED);
77 success = __atomic_compare_exchange_n(&rwl->
cnt, &x, x + 1, 1, __ATOMIC_ACQUIRE,
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, __ATOMIC_ACQUIRE,
119 __atomic_fetch_sub(&rwl->
cnt, 1, __ATOMIC_RELEASE);
137 x = __atomic_load_n(&rwl->
cnt, __ATOMIC_RELAXED);
139 __atomic_compare_exchange_n(&rwl->
cnt, &x, -1, 1, __ATOMIC_ACQUIRE, __ATOMIC_RELAXED) == 0)
157 while (success == 0) {
158 x = __atomic_load_n(&rwl->
cnt, __ATOMIC_RELAXED);
165 __atomic_compare_exchange_n(&rwl->
cnt, &x, -1, 1, __ATOMIC_ACQUIRE, __ATOMIC_RELAXED);
178 __atomic_store_n(&rwl->
cnt, 0, __ATOMIC_RELEASE);
static void cne_rwlock_read_lock(cne_rwlock_t *rwl)
static void cne_rwlock_read_unlock(cne_rwlock_t *rwl)
static void cne_rwlock_write_lock_tm(cne_rwlock_t *rwl)
static int cne_rwlock_write_trylock(cne_rwlock_t *rwl)
static void cne_rwlock_write_unlock(cne_rwlock_t *rwl)
static void cne_rwlock_read_lock_tm(cne_rwlock_t *rwl)
static void cne_rwlock_init(cne_rwlock_t *rwl)
static void cne_rwlock_read_unlock_tm(cne_rwlock_t *rwl)
static int cne_rwlock_read_trylock(cne_rwlock_t *rwl)
static void cne_rwlock_write_lock(cne_rwlock_t *rwl)
static void cne_rwlock_write_unlock_tm(cne_rwlock_t *rwl)