summaryrefslogtreecommitdiffstats
path: root/crypto/threads_none.c
diff options
context:
space:
mode:
authorPauli <paul.dale@oracle.com>2017-10-09 06:39:43 +0200
committerPauli <paul.dale@oracle.com>2017-10-10 00:45:53 +0200
commit30ff41beab5d8a53cbcbdab4109b32b9ef5c0f6e (patch)
treed807a734652467cb791af4cfdfe5330080dca5d1 /crypto/threads_none.c
parentAdd a CRYPTO_atomic_read call which allows an int variable to be read (diff)
downloadopenssl-30ff41beab5d8a53cbcbdab4109b32b9ef5c0f6e.tar.xz
openssl-30ff41beab5d8a53cbcbdab4109b32b9ef5c0f6e.zip
Add atomic write call
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4414)
Diffstat (limited to 'crypto/threads_none.c')
-rw-r--r--crypto/threads_none.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/crypto/threads_none.c b/crypto/threads_none.c
index 7e9ec2d151..30ed4e6999 100644
--- a/crypto/threads_none.c
+++ b/crypto/threads_none.c
@@ -127,7 +127,13 @@ int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock)
int CRYPTO_atomic_read(int *val, int *ret, CRYPTO_RWLOCK *lock)
{
- *ret = *val;
+ *ret = *val;
+ return 1;
+}
+
+int CRYPTO_atomic_write(int *val, int n, CRYPTO_RWLOCK *lock)
+{
+ *val = n;
return 1;
}