diff options
author | Hugo Landau <hlandau@openssl.org> | 2023-05-17 14:15:01 +0200 |
---|---|---|
committer | Hugo Landau <hlandau@openssl.org> | 2023-05-24 11:34:54 +0200 |
commit | 629b408c12c56b2c9e3279de8658718e8dd658a2 (patch) | |
tree | 13916b230422a8d1b27fcf9467ce8bbdcb45646f /crypto/threads_win.c | |
parent | QUIC TSERVER: Use a random port in the tserver test (diff) | |
download | openssl-629b408c12c56b2c9e3279de8658718e8dd658a2.tar.xz openssl-629b408c12c56b2c9e3279de8658718e8dd658a2.zip |
QUIC: Fix bugs where threading is disabled
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20856)
Diffstat (limited to 'crypto/threads_win.c')
-rw-r--r-- | crypto/threads_win.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/crypto/threads_win.c b/crypto/threads_win.c index 7b2e876540..82137b530a 100644 --- a/crypto/threads_win.c +++ b/crypto/threads_win.c @@ -251,6 +251,22 @@ int CRYPTO_atomic_load(uint64_t *val, uint64_t *ret, CRYPTO_RWLOCK *lock) #endif } +int CRYPTO_atomic_load_int(int *val, int *ret, CRYPTO_RWLOCK *lock) +{ +#if (defined(NO_INTERLOCKEDOR64)) + if (lock == NULL || !CRYPTO_THREAD_read_lock(lock)) + return 0; + *ret = *val; + if (!CRYPTO_THREAD_unlock(lock)) + return 0; + + return 1; +#else + *ret = (int)InterlockedOr((LONG volatile *)val, 0); + return 1; +#endif +} + int openssl_init_fork_handlers(void) { return 0; |