Print this page
5042 stop using deprecated atomic functions

@@ -587,11 +587,11 @@
                         t->t_hrtime = newtime;
                         scalehrtime(&delta);
                         pctcpu = t->t_pctcpu;
                         npctcpu = cpu_decay(pctcpu, delta);
                 }
-        } while (cas32(&t->t_pctcpu, pctcpu, npctcpu) != pctcpu);
+        } while (atomic_cas_32(&t->t_pctcpu, pctcpu, npctcpu) != pctcpu);
 
         return (npctcpu);
 }
 
 /*

@@ -655,11 +655,12 @@
                 }
                 oldtime = *mstimep;
                 newtime += oldtime;
                 t->t_mstate = new_state;
                 ms->ms_state_start = curtime;
-        } while (cas64((uint64_t *)mstimep, oldtime, newtime) != oldtime);
+        } 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,11 +780,12 @@
                         oldtime = *mstimep - 1; /* force CAS to fail */
                         continue;
                 }
                 oldtime = *mstimep;
                 newtime += oldtime;
-        } while (cas64((uint64_t *)mstimep, oldtime, 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);