};
static OPENSSL_INIT_STOP *stop_handlers = NULL;
+static CRYPTO_RWLOCK *init_lock = NULL;
static CRYPTO_ONCE base = CRYPTO_ONCE_STATIC_INIT;
static int base_inited = 0;
#ifndef OPENSSL_SYS_UEFI
atexit(OPENSSL_cleanup);
#endif
+ init_lock = CRYPTO_THREAD_lock_new();
OPENSSL_cpuid_setup();
base_inited = 1;
}
OPENSSL_free(lasthandler);
}
stop_handlers = NULL;
+
+ CRYPTO_THREAD_lock_free(init_lock);
+
/*
* We assume we are single-threaded for this function, i.e. no race
* conditions for the various "*_inited" vars below.
if (opts & OPENSSL_INIT_LOAD_CONFIG) {
int ret;
- CRYPTO_w_lock(CRYPTO_LOCK_INIT);
+ CRYPTO_THREAD_write_lock(init_lock);
config_filename = (settings == NULL) ? NULL : settings->config_name;
ret = CRYPTO_THREAD_run_once(&config, ossl_init_config);
- CRYPTO_w_unlock(CRYPTO_LOCK_INIT);
+ CRYPTO_THREAD_unlock(init_lock);
if (!ret)
return 0;
}
"comp",
"fips",
"fips2",
- "init",
-#if CRYPTO_NUM_LOCKS != 42
+#if CRYPTO_NUM_LOCKS != 41
# error "Inconsistency between crypto.h and cryptlib.c"
#endif
};
# define CRYPTO_LOCK_COMP 38
# define CRYPTO_LOCK_FIPS 39
# define CRYPTO_LOCK_FIPS2 40
-# define CRYPTO_LOCK_INIT 41
-# define CRYPTO_NUM_LOCKS 42
+# define CRYPTO_NUM_LOCKS 41
# define CRYPTO_LOCK 1
# define CRYPTO_UNLOCK 2