[RFC,v1,2/5] eal: use wait until scheme for read pflock
Checks
Commit Message
Instead of polling for read pflock update, use wait_until_part_equal
for this case.
Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
lib/eal/include/generic/rte_pflock.h | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
@@ -121,9 +121,8 @@ rte_pflock_read_lock(rte_pflock_t *pf)
return;
/* Wait for current write phase to complete. */
- while ((__atomic_load_n(&pf->rd.in, __ATOMIC_ACQUIRE)
- & RTE_PFLOCK_WBITS) == w)
- rte_pause();
+ rte_wait_until_part_unequal_16(&pf->rd.in,
+ RTE_PFLOCK_WBITS, w, __ATOMIC_ACQUIRE);
}
/**