diff options
author | Hugo Landau <hlandau@openssl.org> | 2023-08-31 18:54:16 +0100 |
---|---|---|
committer | Hugo Landau <hlandau@openssl.org> | 2023-09-05 11:45:44 +0100 |
commit | 17a0e930d2607e1d571c82912d5e1fa3393b2053 (patch) | |
tree | d37ce804c5d2ed697610dc8608c16025f6a0080d /crypto | |
parent | d4231af60a8d04196b3b873c2fa8638daff36173 (diff) | |
download | openssl-17a0e930d2607e1d571c82912d5e1fa3393b2053.tar.gz |
MUTEX: Assert on locking failure
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21919)
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/thread/arch/thread_posix.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/crypto/thread/arch/thread_posix.c b/crypto/thread/arch/thread_posix.c index 0ab27b1230..f88323820f 100644 --- a/crypto/thread/arch/thread_posix.c +++ b/crypto/thread/arch/thread_posix.c @@ -120,18 +120,22 @@ int ossl_crypto_mutex_try_lock(CRYPTO_MUTEX *mutex) void ossl_crypto_mutex_lock(CRYPTO_MUTEX *mutex) { + int rc; pthread_mutex_t *mutex_p; mutex_p = (pthread_mutex_t *)mutex; - pthread_mutex_lock(mutex_p); + rc = pthread_mutex_lock(mutex_p); + OPENSSL_assert(rc == 0); } void ossl_crypto_mutex_unlock(CRYPTO_MUTEX *mutex) { + int rc; pthread_mutex_t *mutex_p; mutex_p = (pthread_mutex_t *)mutex; - pthread_mutex_unlock(mutex_p); + rc = pthread_mutex_unlock(mutex_p); + OPENSSL_assert(rc == 0); } void ossl_crypto_mutex_free(CRYPTO_MUTEX **mutex) |