Print this page
5042 stop using deprecated atomic functions

*** 2771,2782 **** */ if (new > LGRP_LOADAVG_MAX) new = LGRP_LOADAVG_MAX; else if (new < 0) new = 0; ! } while (cas32((lgrp_load_t *)&lpl->lpl_loadavg, old, ! new) != old); } else { /* * We're supposed to update the load, but not age it. * This option is used to update the load (which either * has already been aged in this 1/10 sec. interval or --- 2771,2782 ---- */ if (new > LGRP_LOADAVG_MAX) new = LGRP_LOADAVG_MAX; else if (new < 0) new = 0; ! } while (atomic_cas_32((lgrp_load_t *)&lpl->lpl_loadavg, ! old, new) != old); } else { /* * We're supposed to update the load, but not age it. * This option is used to update the load (which either * has already been aged in this 1/10 sec. interval or
*** 2790,2801 **** * Check for overflow * Underflow not possible here */ if (new < old) new = LGRP_LOADAVG_MAX; ! } while (cas32((lgrp_load_t *)&lpl->lpl_loadavg, old, ! new) != old); } /* * Do the same for this lpl's parent */ --- 2790,2801 ---- * Check for overflow * Underflow not possible here */ if (new < old) new = LGRP_LOADAVG_MAX; ! } while (atomic_cas_32((lgrp_load_t *)&lpl->lpl_loadavg, ! old, new) != old); } /* * Do the same for this lpl's parent */
*** 3352,3362 **** * added in the anticipatory * load */ new = 0; } ! } while (cas32( (lgrp_load_t *)&lpl->lpl_loadavg, old, new) != old); lpl = lpl->lpl_parent; if (lpl == NULL) --- 3352,3362 ---- * added in the anticipatory * load */ new = 0; } ! } while (atomic_cas_32( (lgrp_load_t *)&lpl->lpl_loadavg, old, new) != old); lpl = lpl->lpl_parent; if (lpl == NULL)
*** 3421,3432 **** * Check for overflow * Underflow not possible here */ if (new < old) new = UINT32_MAX; ! } while (cas32((lgrp_load_t *)&lpl->lpl_loadavg, old, ! new) != old); lpl = lpl->lpl_parent; if (lpl == NULL) break; } --- 3421,3432 ---- * Check for overflow * Underflow not possible here */ if (new < old) new = UINT32_MAX; ! } while (atomic_cas_32((lgrp_load_t *)&lpl->lpl_loadavg, ! old, new) != old); lpl = lpl->lpl_parent; if (lpl == NULL) break; }