summaryrefslogtreecommitdiffstats
path: root/crypto/threads_win.c
diff options
context:
space:
mode:
authorPauli <paul.dale@oracle.com>2017-10-11 09:47:54 +1000
committerPauli <paul.dale@oracle.com>2017-10-11 09:47:54 +1000
commitf49452c297438ec349a76dfa38fa26a780084f96 (patch)
tree95b14e9c3ab78f653b57458eabe8eac327e6f441 /crypto/threads_win.c
parent19f05ebc3f5346d89ec7e71feb5504dbd093721a (diff)
Return a value from atomic read on Windows.
Use a read lock when reading using pthreads. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4517)
Diffstat (limited to 'crypto/threads_win.c')
-rw-r--r--crypto/threads_win.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/threads_win.c b/crypto/threads_win.c
index ab2eb25740..f222aa5d03 100644
--- a/crypto/threads_win.c
+++ b/crypto/threads_win.c
@@ -135,7 +135,7 @@ int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock)
int CRYPTO_atomic_read(int *val, int *ret, CRYPTO_RWLOCK *lock)
{
- InterlockedCompareExchange(val, 0, 0);
+ *ret = InterlockedCompareExchange(val, 0, 0);
return 1;
}