[openssl-commits] [openssl] master update

paul.dale at oracle.com paul.dale at oracle.com
Wed Oct 11 00:28:17 UTC 2017


The branch master has been updated
       via  f49452c297438ec349a76dfa38fa26a780084f96 (commit)
      from  19f05ebc3f5346d89ec7e71feb5504dbd093721a (commit)


- Log -----------------------------------------------------------------
commit f49452c297438ec349a76dfa38fa26a780084f96
Author: Pauli <paul.dale at oracle.com>
Date:   Wed Oct 11 09:47:54 2017 +1000

    Return a value from atomic read on Windows.
    Use a read lock when reading using pthreads.
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/4517)

-----------------------------------------------------------------------

Summary of changes:
 crypto/threads_pthread.c | 2 +-
 crypto/threads_win.c     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/crypto/threads_pthread.c b/crypto/threads_pthread.c
index 34be314..3aeef21 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;
diff --git a/crypto/threads_win.c b/crypto/threads_win.c
index ab2eb25..f222aa5 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;
 }
 


More information about the openssl-commits mailing list