[openssl] master update

Matt Caswell matt at openssl.org
Fri Aug 9 12:18:07 UTC 2019


The branch master has been updated
       via  d6dda392c10a9297b5009339a4656ec5bf53399b (commit)
      from  ac5a61caf87652733545e9c2a9219e5986b6a35a (commit)


- Log -----------------------------------------------------------------
commit d6dda392c10a9297b5009339a4656ec5bf53399b
Author: Vladimir Kotal <Vladimir.Kotal at Oracle.COM>
Date:   Fri Jun 21 10:31:05 2019 +0200

    use native atomic increment function on Solaris
    
    Reviewed-by: Paul Dale <paul.dale at oracle.com>
    Reviewed-by: Matt Caswell <matt at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/9215)

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

Summary of changes:
 crypto/threads_pthread.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/crypto/threads_pthread.c b/crypto/threads_pthread.c
index 0d351ca6fa..c3fd2411db 100644
--- a/crypto/threads_pthread.c
+++ b/crypto/threads_pthread.c
@@ -10,6 +10,10 @@
 #include <openssl/crypto.h>
 #include "internal/cryptlib.h"
 
+#if defined(__sun)
+# include <atomic.h>
+#endif
+
 #if defined(OPENSSL_THREADS) && !defined(CRYPTO_TDEBUG) && !defined(OPENSSL_SYS_WINDOWS)
 
 # ifdef PTHREAD_RWLOCK_INITIALIZER
@@ -162,6 +166,12 @@ int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock)
         *ret = __atomic_add_fetch(val, amount, __ATOMIC_ACQ_REL);
         return 1;
     }
+# elif defined(__sun) && (defined(__SunOS_5_10) || defined(__SunOS_5_11))
+    /* This will work for all future Solaris versions. */
+    if (ret != NULL) {
+        *ret = atomic_add_int_nv((volatile unsigned int *)val, amount);
+        return 1;
+    }
 # endif
     if (!CRYPTO_THREAD_write_lock(lock))
         return 0;


More information about the openssl-commits mailing list