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

*** 193,203 **** * registration, mark it as invalid. */ if ((addr = ent->lwpchan_uaddr) != NULL) lwp_mutex_unregister(addr); kmem_free(ent, sizeof (*ent)); ! atomic_add_32(&lcp->lwpchan_entries, -1); } else { prev = &ent->lwpchan_next; } } mutex_exit(&hashbucket->lwpchan_lock); --- 193,203 ---- * registration, mark it as invalid. */ if ((addr = ent->lwpchan_uaddr) != NULL) lwp_mutex_unregister(addr); kmem_free(ent, sizeof (*ent)); ! atomic_dec_32(&lcp->lwpchan_entries); } else { prev = &ent->lwpchan_next; } } mutex_exit(&hashbucket->lwpchan_lock);
*** 466,476 **** ent->lwpchan_type = (uint16_t)type; ent->lwpchan_pool = (uint16_t)pool; ent->lwpchan_lwpchan = *lwpchan; ent->lwpchan_next = hashbucket->lwpchan_chain; hashbucket->lwpchan_chain = ent; ! atomic_add_32(&lcp->lwpchan_entries, 1); mutex_exit(&hashbucket->lwpchan_lock); return (1); } /* --- 466,476 ---- ent->lwpchan_type = (uint16_t)type; ent->lwpchan_pool = (uint16_t)pool; ent->lwpchan_lwpchan = *lwpchan; ent->lwpchan_next = hashbucket->lwpchan_chain; hashbucket->lwpchan_chain = ent; ! atomic_inc_32(&lcp->lwpchan_entries); mutex_exit(&hashbucket->lwpchan_lock); return (1); } /*