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

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/os/pool.c
          +++ new/usr/src/uts/common/os/pool.c
↓ open down ↓ 1679 lines elided ↑ open up ↑
1680 1680                   * p_lock because it cannot change underneath of us.
1681 1681                   * We're holding pool_lock here, so nobody else can be
1682 1682                   * moving this process between pools.  If process "p"
1683 1683                   * would be exiting, we're guaranteed that it would be blocked
1684 1684                   * at pool_barrier_enter() in exit().  Otherwise, it would've
1685 1685                   * been skipped by one of our scans of the practive list
1686 1686                   * as a process with PEXITED flag set.
1687 1687                   */
1688 1688                  if (p->p_pool != pool) {
1689 1689                          ASSERT(p->p_pool->pool_ref > 0);
1690      -                        atomic_add_32(&p->p_pool->pool_ref, -1);
     1690 +                        atomic_dec_32(&p->p_pool->pool_ref);
1691 1691                          p->p_pool = pool;
1692      -                        atomic_add_32(&p->p_pool->pool_ref, 1);
     1692 +                        atomic_inc_32(&p->p_pool->pool_ref);
1693 1693                  }
1694 1694                  /*
1695 1695                   * Okay, we've tortured this guy enough.
1696 1696                   * Let this poor process go now.
1697 1697                   */
1698 1698                  pool_bind_wake(p);
1699 1699          }
1700 1700          if (flags & POOL_BIND_PSET)
1701 1701                  pset_bind_finish();
1702 1702  
↓ open down ↓ 89 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX