atomic macos

This commit is contained in:
dmchen 2024-01-25 09:14:59 +00:00
parent 2a8ef27f33
commit b693d990dc
1 changed files with 2 additions and 2 deletions

View File

@ -130,9 +130,9 @@ int taos_metric_sample_exchange(taos_metric_sample_t *self, double r_value, doub
}
#ifdef DOUBLE_ATOMIC
/*_Atomic*/ double new = ATOMIC_VAR_INIT(r_value);
_Atomic double new = ATOMIC_VAR_INIT(r_value);
for (;;) {
_Atomic double old = atomic_load(&self->r_value);
/*_Atomic*/ double old = atomic_load(&self->r_value);
*old_value = old;
if (atomic_compare_exchange_weak(&self->r_value, &old, new)) {
return 0;