Commit b593fb151e for openssl.org
commit b593fb151eb7373cb85f352e86bcb7225f9850d9
Author: Bob Beck <beck@openssl.org>
Date: Thu Jun 18 12:02:06 2026 -0600
Fix OSSL_ATOMICS_LOCKLESS detection for Windows toolchains
The check referenced USE_INTERLOCKEDOR64, but the macro defined above
for MSVC (with the right architecture/version) and 64-bit MinGW is
OSSL_USE_INTERLOCKEDOR64. As a result, OSSL_ATOMICS_LOCKLESS was
never defined on Windows, even though those toolchains do provide
lockless atomics.
Reported-by: Mounir IDRASSI <mounir.idrassi@idrix.fr>
Fixes: 26c57423933c "Use the actually correct define for solaris and gcc"
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Milan Broz <mbroz@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Mon Jun 22 07:22:31 2026
(Merged from https://github.com/openssl/openssl/pull/31600)
diff --git a/include/internal/threads_common.h b/include/internal/threads_common.h
index b6dea47ab9..e32257d630 100644
--- a/include/internal/threads_common.h
+++ b/include/internal/threads_common.h
@@ -88,7 +88,7 @@ void CRYPTO_THREAD_clean_local(void);
#endif
/* Allow us to know if atomics will be implemented with a fallback lock or not. */
-#if defined(OSSL_USE_GCC_ATOMICS) || defined(OSSL_USE_SOLARIS_ATOMICS) || defined(USE_INTERLOCKEDOR64)
+#if defined(OSSL_USE_GCC_ATOMICS) || defined(OSSL_USE_SOLARIS_ATOMICS) || defined(OSSL_USE_INTERLOCKEDOR64)
#define OSSL_ATOMICS_LOCKLESS
#endif