On 13/10/2026 02:37, [email protected] wrote:
Heikki, do the acquire loads and separate pthread_once work address
your concerns?

Yeah.

+       /* Acquire the initialization state without a read-modify-write. */
+#ifdef _MSC_VER
+       if (ReadAcquire(&mp->initstate) != 1)
+#else
+       if (__atomic_load_n(&mp->initstate, __ATOMIC_ACQUIRE) != 1)
+#endif

Hmm, so ReadAcquire is only available on Visual Studio, and the else-branch is for mingw builds? Is there no atomic read intrinsic similar InterlockedCompareExchange() that would work on both?

- Heikki



Reply via email to