threads: fix msvc build without openmp (#9615)

We're missing atomic_thread_fence() in MSVC builds when openmp is disabled.
This commit is contained in:
Max Krasnyansky 2024-09-23 21:18:48 -07:00 committed by GitHub
parent 116efee0ee
commit c087b6f11d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -135,6 +135,9 @@ static atomic_bool atomic_flag_test_and_set(atomic_flag * ptr) {
static void atomic_flag_clear(atomic_flag * ptr) {
InterlockedExchange(ptr, 0);
}
static void atomic_thread_fence(memory_order mo) {
MemoryBarrier();
}
#else // clang
#include <stdatomic.h>
#endif