summaryrefslogtreecommitdiffstats
path: root/crypto/bio/bio_meth.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/bio/bio_meth.c')
-rw-r--r--crypto/bio/bio_meth.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/crypto/bio/bio_meth.c b/crypto/bio/bio_meth.c
index d7d480ea4f..ca03b5c423 100644
--- a/crypto/bio/bio_meth.c
+++ b/crypto/bio/bio_meth.c
@@ -10,18 +10,16 @@
#include "bio_local.h"
#include "internal/thread_once.h"
-CRYPTO_RWLOCK *bio_type_lock = NULL;
+CRYPTO_REF_COUNT bio_type_count;
static CRYPTO_ONCE bio_type_init = CRYPTO_ONCE_STATIC_INIT;
DEFINE_RUN_ONCE_STATIC(do_bio_type_init)
{
- bio_type_lock = CRYPTO_THREAD_lock_new();
- return bio_type_lock != NULL;
+ return CRYPTO_NEW_REF(&bio_type_count, BIO_TYPE_START);
}
int BIO_get_new_index(void)
{
- static CRYPTO_REF_COUNT bio_count = BIO_TYPE_START;
int newval;
if (!RUN_ONCE(&bio_type_init, do_bio_type_init)) {
@@ -29,7 +27,7 @@ int BIO_get_new_index(void)
ERR_raise(ERR_LIB_BIO, ERR_R_CRYPTO_LIB);
return -1;
}
- if (!CRYPTO_UP_REF(&bio_count, &newval, bio_type_lock))
+ if (!CRYPTO_UP_REF(&bio_type_count, &newval))
return -1;
return newval;
}