Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1922)
if ((init_lock = CRYPTO_THREAD_lock_new()) == NULL)
return 0;
OPENSSL_cpuid_setup();
+
+ /*
+ * BIG FAT WARNING!
+ * Everything needed to be initialized in this function before threads
+ * come along MUST happen before base_inited is set to 1, or we will
+ * see race conditions.
+ */
base_inited = 1;
#if !defined(OPENSSL_NO_DSO) && !defined(OPENSSL_USE_NODELETE)