{
DWORD timeout;
- fprintf(stderr, "# wt\n"); fflush(stderr);
if (!determine_timeout(deadline, &timeout))
timeout = 1;
ossl_crypto_mutex_unlock(mutex);
WaitForSingleObject((HANDLE)cv, timeout);
- fprintf(stderr, "# wtd\n"); fflush(stderr);
ossl_crypto_mutex_lock(mutex);
- fprintf(stderr, "# wtd2\n"); fflush(stderr);
}
void ossl_crypto_condvar_broadcast(CRYPTO_CONDVAR *cv)
*
* Precondition: Channel mutex is not held (unchecked)
*/
-static int quic_lock(QUIC_CONNECTION *qc)
+static void quic_lock(QUIC_CONNECTION *qc)
{
ossl_crypto_mutex_lock(qc->mutex);
- return 1;
}
/* Precondition: Channel mutex is held (unchecked) */
if (!expect_quic_conn(qc))
return;
- quic_lock(qc); /* best effort */
+ quic_lock(qc);
if (qc->is_thread_assisted && qc->started) {
ossl_quic_thread_assist_wait_stopped(&qc->thread_assist);
QUIC_TAKES_LOCK
int ossl_quic_tick(QUIC_CONNECTION *qc)
{
- if (!quic_lock(qc))
- return 0;
+ quic_lock(qc);
if (qc->ch == NULL) {
quic_unlock(qc);
{
OSSL_TIME deadline = ossl_time_infinite();
- if (!quic_lock(qc))
- return 0;
+ quic_lock(qc);
if (qc->ch != NULL)
deadline
{
int ret;
- if (!quic_lock(qc))
- return 0;
+ quic_lock(qc);
if (qc->ch == NULL)
return 0;
{
int ret;
- if (!quic_lock(qc))
- return 0;
+ quic_lock(qc);
if (qc->ch == NULL)
return 0;
{
int ret;
- if (!quic_lock(qc))
- return -1;
+ quic_lock(qc);
if (!ensure_channel(qc)) {
quic_unlock(qc);
{
int ret;
- if (!quic_lock(qc))
- return -1;
+ quic_lock(qc);
ret = quic_do_handshake(qc);
quic_unlock(qc);
if (!expect_quic_conn(qc))
return 0;
- if (!quic_lock(qc))
- return 0;
+ quic_lock(qc);
if (qc->ch != NULL && ossl_quic_channel_is_term_any(qc->ch)) {
ret = QUIC_RAISE_NON_NORMAL_ERROR(qc, SSL_R_PROTOCOL_IS_SHUTDOWN, NULL);
if (!expect_quic_conn(qc))
return 0;
- if (!quic_lock(qc))
- return 0;
+ quic_lock(qc);
if (qc->ch != NULL && ossl_quic_channel_is_term_any(qc->ch)) {
ret = QUIC_RAISE_NON_NORMAL_ERROR(qc, SSL_R_PROTOCOL_IS_SHUTDOWN, NULL);
if (!expect_quic_conn(qc))
return 0;
- if (!quic_lock((QUIC_CONNECTION *)qc))
- return 0;
+ quic_lock((QUIC_CONNECTION *)qc);
if (qc->stream0 == NULL || qc->stream0->rstream == NULL)
/* Cannot raise errors here because we are const, just fail. */
{
QUIC_STREAM *qs = qc->stream0;
- if (!quic_lock(qc))
- return 0;
+ quic_lock(qc);
if (qs == NULL || qs->sstream == NULL) {
quic_unlock(qc);