Print this page
5045 use atomic_{inc,dec}_* instead of atomic_add_*
@@ -272,11 +272,11 @@
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);
+ atomic_dec_32(&cp->p_pool->pool_ref);
mutex_exit(&cp->p_lock);
pid_exit(cp, tk);
mutex_exit(&pidlock);
task_rele(tk);
@@ -626,11 +626,11 @@
*/
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);
+ 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,11 +1126,11 @@
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);
+ 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.