diff options
author | Kurt Roeckx <kurt@roeckx.be> | 2016-08-27 16:01:08 +0200 |
---|---|---|
committer | Kurt Roeckx <kurt@roeckx.be> | 2016-11-17 22:02:25 +0100 |
commit | 2f545ae45d4b93649e40ff7f93e2c3e6ce3154ae (patch) | |
tree | f29ebce27f6c271c3e7f99a3f96df6c4aadd5404 /crypto/bio/bio_meth.c | |
parent | b6c6898234a12b9c6cdaa8f16fb9156097649ad7 (diff) |
Add support for reference counting using C11 atomics
Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
GH: #1500
Diffstat (limited to 'crypto/bio/bio_meth.c')
-rw-r--r-- | crypto/bio/bio_meth.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/bio/bio_meth.c b/crypto/bio/bio_meth.c index 588c5170f7..3cbac5bf85 100644 --- a/crypto/bio/bio_meth.c +++ b/crypto/bio/bio_meth.c @@ -21,14 +21,14 @@ DEFINE_RUN_ONCE_STATIC(do_bio_type_init) int BIO_get_new_index() { - static int bio_count = BIO_TYPE_START; + static CRYPTO_REF_COUNT bio_count = BIO_TYPE_START; int newval; if (!RUN_ONCE(&bio_type_init, do_bio_type_init)) { BIOerr(BIO_F_BIO_GET_NEW_INDEX, ERR_R_MALLOC_FAILURE); return -1; } - if (!CRYPTO_atomic_add(&bio_count, 1, &newval, bio_type_lock)) + if (!CRYPTO_UP_REF(&bio_count, &newval, bio_type_lock)) return -1; return newval; } |