Print this page
5045 use atomic_{inc,dec}_* instead of atomic_add_*
*** 957,967 ****
}
#define DCB_RD_EXIT(cpu) { \
uint32_t *rp = &nca_gv[cpu].dcb_readers; \
\
! if (atomic_add_32_nv(rp, -1) == DCB_COUNT_USELOCK) { \
mutex_enter(&nca_dcb_lock); \
if (CV_HAS_WAITERS(&nca_dcb_wait)) { \
/* May be the last reader for this CPU */ \
cv_signal(&nca_dcb_wait); \
} \
--- 957,967 ----
}
#define DCB_RD_EXIT(cpu) { \
uint32_t *rp = &nca_gv[cpu].dcb_readers; \
\
! if (atomic_dec_32_nv(rp) == DCB_COUNT_USELOCK) { \
mutex_enter(&nca_dcb_lock); \
if (CV_HAS_WAITERS(&nca_dcb_wait)) { \
/* May be the last reader for this CPU */ \
cv_signal(&nca_dcb_wait); \
} \