When calling ossl_crypto_condvar_wait_timeout() we must use real time
authorMatt Caswell <matt@openssl.org>
Fri, 6 Oct 2023 14:56:15 +0000 (15:56 +0100)
committerMatt Caswell <matt@openssl.org>
Tue, 10 Oct 2023 07:17:43 +0000 (08:17 +0100)
commit2b8d81534479b161dda063477272363fb2caef08
treebe3113450ccfdebc31a372696dcd635bf929a851
parent91895e39b10033178e662fc7427a09d7562cf8e1
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)
include/internal/quic_thread_assist.h
ssl/quic/quic_impl.c
ssl/quic/quic_thread_assist.c