aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2016-11-15 00:58:51 +0100
committerRichard Levitte <levitte@openssl.org>2016-11-15 01:27:26 +0100
commit8aa9cf7e655ae1e41f283fbf16dcc810970058a0 (patch)
treedac76c07dc5b8c3f585660f87c0fad9078d8d92a
parentb7a7f39afeb4748b4c25dbccb8951711b8b70eaf (diff)
downloadopenssl-8aa9cf7e655ae1e41f283fbf16dcc810970058a0.zip
openssl-8aa9cf7e655ae1e41f283fbf16dcc810970058a0.tar.gz
openssl-8aa9cf7e655ae1e41f283fbf16dcc810970058a0.tar.bz2
Add a warning stipulating how things should be coded in ossl_init_base
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1922)
-rw-r--r--crypto/init.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/crypto/init.c b/crypto/init.c
index 01619bc..3f91119 100644
--- a/crypto/init.c
+++ b/crypto/init.c
@@ -79,6 +79,13 @@ DEFINE_RUN_ONCE_STATIC(ossl_init_base)
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)