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

*** 272,282 **** cp->p_psibling->p_sibling = cp->p_sibling; mutex_enter(&cp->p_lock); tk = cp->p_task; task_detach(cp); ASSERT(cp->p_pool->pool_ref > 0); ! atomic_add_32(&cp->p_pool->pool_ref, -1); mutex_exit(&cp->p_lock); pid_exit(cp, tk); mutex_exit(&pidlock); task_rele(tk); --- 272,282 ---- cp->p_psibling->p_sibling = cp->p_sibling; mutex_enter(&cp->p_lock); tk = cp->p_task; task_detach(cp); ASSERT(cp->p_pool->pool_ref > 0); ! atomic_dec_32(&cp->p_pool->pool_ref); mutex_exit(&cp->p_lock); pid_exit(cp, tk); mutex_exit(&pidlock); task_rele(tk);
*** 626,636 **** */ mutex_enter(&cp->p_lock); tk = cp->p_task; task_detach(cp); ASSERT(cp->p_pool->pool_ref > 0); ! atomic_add_32(&cp->p_pool->pool_ref, -1); mutex_exit(&cp->p_lock); orphpp = &p->p_orphan; while (*orphpp != cp) orphpp = &(*orphpp)->p_nextorph; --- 626,636 ---- */ mutex_enter(&cp->p_lock); tk = cp->p_task; task_detach(cp); ASSERT(cp->p_pool->pool_ref > 0); ! atomic_dec_32(&cp->p_pool->pool_ref); mutex_exit(&cp->p_lock); orphpp = &p->p_orphan; while (*orphpp != cp) orphpp = &(*orphpp)->p_nextorph;
*** 1126,1136 **** cp->p_pool = pool_default; cp->p_flag |= SSYS; } else { cp->p_pool = pp->p_pool; } ! atomic_add_32(&cp->p_pool->pool_ref, 1); mutex_exit(&pp->p_lock); /* * Add the child process to the current task. Kernel processes * are always attached to task0. --- 1126,1136 ---- cp->p_pool = pool_default; cp->p_flag |= SSYS; } else { cp->p_pool = pp->p_pool; } ! atomic_inc_32(&cp->p_pool->pool_ref); mutex_exit(&pp->p_lock); /* * Add the child process to the current task. Kernel processes * are always attached to task0.