summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2023-10-06 15:56:15 +0100
committerMatt Caswell <matt@openssl.org>2023-10-10 08:17:43 +0100
commit2b8d81534479b161dda063477272363fb2caef08 (patch)
treebe3113450ccfdebc31a372696dcd635bf929a851 /include
parent91895e39b10033178e662fc7427a09d7562cf8e1 (diff)
When calling ossl_crypto_condvar_wait_timeout() we must use real time
Although many of the QUIC tests use fake time, the time we pass to the ossl_crypto_condvar_wait_timeout() must be a real time. Passing fake time was causing the QUIC tserver test to hang because ossl_crypto_convar_wait_timeout() always timed out immediately and never relinquished the CPU. If using fake time we adjust the time to real time just before using it. Fixes #22020 Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22301)
Diffstat (limited to 'include')
-rw-r--r--include/internal/quic_thread_assist.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/internal/quic_thread_assist.h b/include/internal/quic_thread_assist.h
index 7d1b47453a..592c2ffabf 100644
--- a/include/internal/quic_thread_assist.h
+++ b/include/internal/quic_thread_assist.h
@@ -12,6 +12,7 @@
# include <openssl/ssl.h>
# include "internal/thread.h"
+# include "internal/time.h"
# if defined(OPENSSL_NO_QUIC) || defined(OPENSSL_NO_THREAD_POOL)
# define OPENSSL_NO_QUIC_THREAD_ASSIST
@@ -46,6 +47,8 @@ typedef struct quic_thread_assist_st {
CRYPTO_CONDVAR *cv;
CRYPTO_THREAD *t;
int teardown, joined;
+ OSSL_TIME (*now_cb)(void *arg);
+ void *now_cb_arg;
} QUIC_THREAD_ASSIST;
/*
@@ -55,7 +58,9 @@ typedef struct quic_thread_assist_st {
* not affect the state of the mutex.
*/
int ossl_quic_thread_assist_init_start(QUIC_THREAD_ASSIST *qta,
- QUIC_CHANNEL *ch);
+ QUIC_CHANNEL *ch,
+ OSSL_TIME (*now_cb)(void *arg),
+ void *now_cb_arg);
/*
* Request the thread assist helper to begin stopping the assist thread. This