From: Intel Date: Wed, 19 Dec 2012 23:00:00 +0000 (+0100) Subject: lib: remove duplicated lock code X-Git-Tag: spdx-start~11410 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=45d54230927df799897bcb606d7ef3ff2bb2046e;p=dpdk.git lib: remove duplicated lock code Signed-off-by: Intel --- diff --git a/lib/librte_eal/common/include/rte_rwlock.h b/lib/librte_eal/common/include/rte_rwlock.h index 38f6c0634d..8568404140 100644 --- a/lib/librte_eal/common/include/rte_rwlock.h +++ b/lib/librte_eal/common/include/rte_rwlock.h @@ -113,14 +113,7 @@ rte_rwlock_read_lock(rte_rwlock_t *rwl) static inline void rte_rwlock_read_unlock(rte_rwlock_t *rwl) { - /* in debug mode, we should check that rwl->cnt is > 0 */ - - /* same than atomic32_dec */ - asm volatile(MPLOCKED - "decl %[cnt]" - : [cnt] "=m" (rwl->cnt) /* output (0) */ - : "m" (rwl->cnt) /* input (1) */ - ); /* no clobber-list */ + rte_atomic32_dec((rte_atomic32_t *)(intptr_t)&rwl->cnt); } /** @@ -156,14 +149,7 @@ rte_rwlock_write_lock(rte_rwlock_t *rwl) static inline void rte_rwlock_write_unlock(rte_rwlock_t *rwl) { - /* in debug mode, we should check that rwl->cnt is < 0 */ - - /* same than atomic32_inc */ - asm volatile(MPLOCKED - "incl %[cnt]" - : [cnt] "=m" (rwl->cnt) /* output (0) */ - : "m" (rwl->cnt) /* input (1) */ - ); /* no clobber-list */ + rte_atomic32_inc((rte_atomic32_t *)(intptr_t)&rwl->cnt); } #ifdef __cplusplus