summaryrefslogtreecommitdiffstats
path: root/crypto/dh/dh_lib.c
diff options
context:
space:
mode:
authorKurt Roeckx <kurt@roeckx.be>2016-08-27 16:01:08 +0200
committerKurt Roeckx <kurt@roeckx.be>2016-11-17 22:02:25 +0100
commit2f545ae45d4b93649e40ff7f93e2c3e6ce3154ae (patch)
treef29ebce27f6c271c3e7f99a3f96df6c4aadd5404 /crypto/dh/dh_lib.c
parentb6c6898234a12b9c6cdaa8f16fb9156097649ad7 (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/dh/dh_lib.c')
-rw-r--r--crypto/dh/dh_lib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/dh/dh_lib.c b/crypto/dh/dh_lib.c
index adf1771514..3dfe7c4e58 100644
--- a/crypto/dh/dh_lib.c
+++ b/crypto/dh/dh_lib.c
@@ -111,7 +111,7 @@ void DH_free(DH *r)
if (r == NULL)
return;
- CRYPTO_atomic_add(&r->references, -1, &i, r->lock);
+ CRYPTO_DOWN_REF(&r->references, &i, r->lock);
REF_PRINT_COUNT("DH", r);
if (i > 0)
return;
@@ -142,7 +142,7 @@ int DH_up_ref(DH *r)
{
int i;
- if (CRYPTO_atomic_add(&r->references, 1, &i, r->lock) <= 0)
+ if (CRYPTO_UP_REF(&r->references, &i, r->lock) <= 0)
return 0;
REF_PRINT_COUNT("DH", r);