diff options
author | Pauli <paul.dale@oracle.com> | 2017-10-11 01:47:54 +0200 |
---|---|---|
committer | Pauli <paul.dale@oracle.com> | 2017-10-11 01:47:54 +0200 |
commit | f49452c297438ec349a76dfa38fa26a780084f96 (patch) | |
tree | 95b14e9c3ab78f653b57458eabe8eac327e6f441 /crypto/threads_pthread.c | |
parent | Fix typos (diff) | |
download | openssl-f49452c297438ec349a76dfa38fa26a780084f96.tar.xz openssl-f49452c297438ec349a76dfa38fa26a780084f96.zip |
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_pthread.c')
-rw-r--r-- | crypto/threads_pthread.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/threads_pthread.c b/crypto/threads_pthread.c index 34be314f1f..3aeef21668 100644 --- a/crypto/threads_pthread.c +++ b/crypto/threads_pthread.c @@ -177,7 +177,7 @@ int CRYPTO_atomic_read(int *val, int *ret, CRYPTO_RWLOCK *lock) return 1; } # endif - if (!CRYPTO_THREAD_write_lock(lock)) + if (!CRYPTO_THREAD_read_lock(lock)) return 0; *ret = *val; |