]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
crypto/threads_pthread.c optimize ossl_(un)likely
authorNorbert Pocs <norbertp@openssl.org>
Thu, 3 Jul 2025 14:11:39 +0000 (16:11 +0200)
committerNeil Horman <nhorman@openssl.org>
Wed, 16 Jul 2025 17:07:15 +0000 (13:07 -0400)
Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27961)

crypto/threads_pthread.c

index e3b262e7db71de0230d42c90eaacc89e0c3d917c..df7954f84cc734182b4ca648740c88be32eb11bc 100644 (file)
@@ -901,7 +901,7 @@ void CRYPTO_THREAD_lock_free(CRYPTO_RWLOCK *lock)
 
 int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))
 {
-    if (pthread_once(once, init) != 0)
+    if (ossl_unlikely(pthread_once(once, init) != 0))
         return 0;
 
     return 1;