Print this page
5045 use atomic_{inc,dec}_* instead of atomic_add_*

*** 351,361 **** * a reference count of 1 (for the table's pointer), plus 1 more for every * pointer that is referencing the ipsa_t. */ #define IPSA_REFHOLD(ipsa) { \ ! atomic_add_32(&(ipsa)->ipsa_refcnt, 1); \ ASSERT((ipsa)->ipsa_refcnt != 0); \ } /* * Decrement the reference count on the SA. --- 351,361 ---- * a reference count of 1 (for the table's pointer), plus 1 more for every * pointer that is referencing the ipsa_t. */ #define IPSA_REFHOLD(ipsa) { \ ! atomic_inc_32(&(ipsa)->ipsa_refcnt); \ ASSERT((ipsa)->ipsa_refcnt != 0); \ } /* * Decrement the reference count on the SA.
*** 366,376 **** */ #define IPSA_REFRELE(ipsa) { \ ASSERT((ipsa)->ipsa_refcnt != 0); \ membar_exit(); \ ! if (atomic_add_32_nv(&(ipsa)->ipsa_refcnt, -1) == 0) \ ((ipsa)->ipsa_freefunc)(ipsa); \ } /* * Security association hash macros and definitions. For now, assume the --- 366,376 ---- */ #define IPSA_REFRELE(ipsa) { \ ASSERT((ipsa)->ipsa_refcnt != 0); \ membar_exit(); \ ! if (atomic_dec_32_nv(&(ipsa)->ipsa_refcnt) == 0) \ ((ipsa)->ipsa_freefunc)(ipsa); \ } /* * Security association hash macros and definitions. For now, assume the