File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
libc/src/__support/time/windows Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -23,15 +23,16 @@ namespace LIBC_NAMESPACE_DECL {
2323namespace internal {
2424static long long get_ticks_per_second () {
2525 static cpp::Atomic<long long > frequency = 0 ;
26- if (!frequency) {
26+ auto freq = frequency.load (cpp::MemoryOrder::RELAXED);
27+ if (!freq) {
2728 UNINITIALIZED LARGE_INTEGER buffer;
2829 // On systems that run Windows XP or later, the function will always
2930 // succeed and will thus never return zero.
3031 ::QueryPerformanceFrequency (&buffer);
31- frequency = buffer.QuadPart ;
32+ frequency. store ( buffer.QuadPart , cpp::MemoryOrder::RELAXED) ;
3233 return buffer.QuadPart ;
3334 }
34- return frequency. load (cpp::MemoryOrder::RELAXED) ;
35+ return freq ;
3536}
3637
3738ErrorOr<int > clock_gettime (clockid_t clockid, timespec *ts) {
You can’t perform that action at this time.
0 commit comments