Commits on Aug 22, 2026
-
Fix races in Windows pthread emulation
The Windows mutex initialization code used InterlockedExchange to claim initialization. A waiter could overwrite the initialized state with the initializing state, causing pthread_mutex_unlock to return without leaving the critical section and deadlock. Use compare-and-exchange to claim only an uninitialized mutex. Use interlocked reads and publication for the mutex and once state so initialized objects are safely visible on ARM64. Apply the mutex fix to the duplicate ECPG and libpq implementations.