Fix GitHub Actions for threading.

PiperOrigin-RevId: 922926969
Change-Id: I968e6b130b6125dbc0ec65ba913d04292270b563
This commit is contained in:
Kyle Bayes
2026-05-28 12:56:19 -07:00
committed by Copybara-Service
parent 9436972a22
commit b612d352d4
3 changed files with 35 additions and 4 deletions
+10
View File
@@ -69,6 +69,16 @@
#endif
#endif
// Atomics helper for size_t.
#if defined(_MSC_VER) && !defined(__clang__)
#include <intrin.h>
#define mj_atomic_add_size_t(ptr, val) \
(size_t)_InterlockedExchangeAdd64((__int64 volatile*)(ptr), (__int64)(val))
#else
#define mj_atomic_add_size_t(ptr, val) \
__atomic_fetch_add(ptr, val, __ATOMIC_RELAXED)
#endif
#ifdef __cplusplus
extern "C" {
#endif