perf: Optimize ATOMIC_READ
This commit is contained in:
@@ -41,7 +41,7 @@ void timestamp_update(struct timestamp *ts)
|
||||
clock_gettime(CLOCK_MONOTONIC, &temp);
|
||||
uint64_t current_timestamp_ms = temp.tv_sec * 1000 + temp.tv_nsec / 1000000;
|
||||
|
||||
__atomic_store_n(&ts->timestamp_ms, current_timestamp_ms, __ATOMIC_RELEASE);
|
||||
ATOMIC_SET(&ts->timestamp_ms, current_timestamp_ms);
|
||||
}
|
||||
|
||||
uint64_t timestamp_update_interval_ms(struct timestamp *ts)
|
||||
@@ -51,5 +51,5 @@ uint64_t timestamp_update_interval_ms(struct timestamp *ts)
|
||||
|
||||
uint64_t timestamp_get_msec(struct timestamp *ts)
|
||||
{
|
||||
return __atomic_load_n(&ts->timestamp_ms, __ATOMIC_ACQUIRE);
|
||||
return ATOMIC_READ(&ts->timestamp_ms);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user