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

*** 25,36 **** */ #ifndef _SYS_SOCKFS_NL7CURI_H #define _SYS_SOCKFS_NL7CURI_H - #pragma ident "%Z%%M% %I% %E% SMI" - #ifdef __cplusplus extern "C" { #endif #include <sys/types.h> --- 25,34 ----
*** 81,96 **** (container)->ref.last = (void (*)(void *))((inactive)); \ (container)->ref.kmc = (kmem); \ } #define REF_HOLD(container) { \ ! atomic_add_32(&(container)->ref.cnt, 1); \ ASSERT((container)->ref.cnt != 0); \ } #define REF_RELE(container) { \ ! if (atomic_add_32_nv(&(container)->ref.cnt, -1) == 0) { \ (container)->ref.last((container)); \ kmem_cache_free((container)->ref.kmc, (container)); \ } \ } --- 79,94 ---- (container)->ref.last = (void (*)(void *))((inactive)); \ (container)->ref.kmc = (kmem); \ } #define REF_HOLD(container) { \ ! atomic_inc_32(&(container)->ref.cnt); \ ASSERT((container)->ref.cnt != 0); \ } #define REF_RELE(container) { \ ! if (atomic_dec_32_nv(&(container)->ref.cnt) == 0) { \ (container)->ref.last((container)); \ kmem_cache_free((container)->ref.kmc, (container)); \ } \ }