/* remove the bit, used for the lock */
curr_sec = ctr->curr_sec & 0x7fffffff;
}
- while (!HA_ATOMIC_CAS(&ctr->curr_sec, &curr_sec, curr_sec | 0x80000000));
+ while (!_HA_ATOMIC_CAS(&ctr->curr_sec, &curr_sec, curr_sec | 0x80000000));
+ __ha_barrier_atomic_store();
elapsed = (now.tv_sec & 0x7fffffff)- curr_sec;
if (unlikely(elapsed > 0)) {
tot_inc = ctr->curr_ctr;
/* release the lock and update the time in case of rotate. */
- HA_ATOMIC_STORE(&ctr->curr_sec, curr_sec & 0x7fffffff);
+ _HA_ATOMIC_STORE(&ctr->curr_sec, curr_sec & 0x7fffffff);
return tot_inc;
/* Note: later we may want to propagate the update to other counters */
}
/* remove the bit, used for the lock */
curr_tick = (ctr->curr_tick >> 1) << 1;
}
- while (!HA_ATOMIC_CAS(&ctr->curr_tick, &curr_tick, curr_tick | 0x1));
+ while (!_HA_ATOMIC_CAS(&ctr->curr_tick, &curr_tick, curr_tick | 0x1));
+ __ha_barrier_atomic_store();
if (now_ms - curr_tick >= period) {
ctr->prev_ctr = ctr->curr_ctr;
ctr->curr_ctr += inc;
tot_inc = ctr->curr_ctr;
/* release the lock and update the time in case of rotate. */
- HA_ATOMIC_STORE(&ctr->curr_tick, (curr_tick >> 1) << 1);
+ _HA_ATOMIC_STORE(&ctr->curr_tick, (curr_tick >> 1) << 1);
return tot_inc;
/* Note: later we may want to propagate the update to other counters */
}