Print this page
5042 stop using deprecated atomic functions

*** 587,597 **** t->t_hrtime = newtime; scalehrtime(&delta); pctcpu = t->t_pctcpu; npctcpu = cpu_decay(pctcpu, delta); } ! } while (cas32(&t->t_pctcpu, pctcpu, npctcpu) != pctcpu); return (npctcpu); } /* --- 587,597 ---- t->t_hrtime = newtime; scalehrtime(&delta); pctcpu = t->t_pctcpu; npctcpu = cpu_decay(pctcpu, delta); } ! } while (atomic_cas_32(&t->t_pctcpu, pctcpu, npctcpu) != pctcpu); return (npctcpu); } /*
*** 655,665 **** } oldtime = *mstimep; newtime += oldtime; t->t_mstate = new_state; ms->ms_state_start = curtime; ! } while (cas64((uint64_t *)mstimep, oldtime, newtime) != oldtime); /* * When the system boots the initial startup thread will have a * ms_state_start of 0 which would add a huge system time to the global * zone. We want to skip aggregating that initial bit of work. --- 655,666 ---- } oldtime = *mstimep; newtime += oldtime; t->t_mstate = new_state; ms->ms_state_start = curtime; ! } while (atomic_cas_64((uint64_t *)mstimep, oldtime, newtime) != ! oldtime); /* * When the system boots the initial startup thread will have a * ms_state_start of 0 which would add a huge system time to the global * zone. We want to skip aggregating that initial bit of work.
*** 779,789 **** oldtime = *mstimep - 1; /* force CAS to fail */ continue; } oldtime = *mstimep; newtime += oldtime; ! } while (cas64((uint64_t *)mstimep, oldtime, newtime) != oldtime); /* * Update the WAIT_CPU timer and per-cpu waitrq total. */ z = ttozone(t); --- 780,791 ---- oldtime = *mstimep - 1; /* force CAS to fail */ continue; } oldtime = *mstimep; newtime += oldtime; ! } while (atomic_cas_64((uint64_t *)mstimep, oldtime, newtime) != ! oldtime); /* * Update the WAIT_CPU timer and per-cpu waitrq total. */ z = ttozone(t);