Check for __GNUC__ to use GNU C atomic buildins
Note: we trust any other compiler that fully implements GNU extension to define __GNUC__ RT#4642 Reviewed-by: Andy Polyakov <appro@openssl.org>
This commit is contained in:
parent
63db6b772f
commit
cb4b54c23b
1 changed files with 3 additions and 3 deletions
|
@ -109,7 +109,7 @@ int CRYPTO_THREAD_compare_id(CRYPTO_THREAD_ID a, CRYPTO_THREAD_ID b)
|
|||
|
||||
int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock)
|
||||
{
|
||||
#ifdef __ATOMIC_RELAXED
|
||||
# if defined(__GNUC__) && defined(__ATOMIC_RELAXED)
|
||||
*ret = __atomic_add_fetch(val, amount, __ATOMIC_RELAXED);
|
||||
# else
|
||||
if (!CRYPTO_THREAD_write_lock(lock))
|
||||
|
|
Loading…
Reference in a new issue