qc->engine = NULL;
}
+#if defined(OPENSSL_THREADS)
if (have_lock)
/* tsan doesn't like freeing locked mutexes */
ossl_crypto_mutex_unlock(qc->mutex);
-#if defined(OPENSSL_THREADS)
if (qc->listener == NULL)
ossl_crypto_mutex_free(&qc->mutex);
#endif
ossl_quic_port_drop_incoming(ctx->ql->port);
ossl_quic_port_free(ctx->ql->port);
ossl_quic_engine_free(ctx->ql->engine);
+#if defined(OPENSSL_THREADS)
ossl_crypto_mutex_free(&ctx->ql->mutex);
+#endif
}
QUIC_TAKES_LOCK
engine_args.libctx = ctx->libctx;
engine_args.propq = ctx->propq;
+#if defined(OPENSSL_THREADS)
engine_args.mutex = qc->mutex;
+#endif
engine_args.now_cb = get_time_cb;
engine_args.now_cb_arg = qc;
qc->engine = ossl_quic_engine_new(&engine_args);
engine_args.libctx = ctx->libctx;
engine_args.propq = ctx->propq;
+#if defined(OPENSSL_THREADS)
engine_args.mutex = ql->mutex;
+#endif
if ((ql->engine = ossl_quic_engine_new(&engine_args)) == NULL) {
QUIC_RAISE_NON_NORMAL_ERROR(NULL, ERR_R_INTERNAL_ERROR, NULL);
goto err;
if (ql != NULL)
ossl_quic_engine_free(ql->engine);
+#if defined(OPENSSL_THREADS)
+ ossl_crypto_mutex_free(&ql->mutex);
+#endif
OPENSSL_free(ql);
return NULL;
}
qc->engine = ql->engine;
qc->port = ql->port;
qc->ch = ch;
+#if defined(OPENSSL_THREADS)
qc->mutex = ql->mutex;
+#endif
qc->tls = ossl_quic_channel_get0_tls(ch);
qc->last_net_bio_epoch = UINT64_MAX;
qc->started = 1;
* The mutex used to synchronise access to the QUIC_CHANNEL. We own this but
* provide it to the channel.
*/
+#if defined(OPENSSL_THREADS)
CRYPTO_MUTEX *mutex;
+#endif
/*
* If we have a default stream attached, this is the internal XSO
/* The QUIC port representing the QUIC listener and socket. */
QUIC_PORT *port;
+#if defined(OPENSSL_THREADS)
/*
* The mutex used to synchronise access to the QUIC_ENGINE. We own this but
* provide it to the engine.
*/
CRYPTO_MUTEX *mutex;
+#endif
/* Have we started listening yet? */
unsigned int listening : 1;