Skip to content

Commit

Permalink
backend: Use PTOK macro for pthread calls
Browse files Browse the repository at this point in the history
  • Loading branch information
walid-git committed Jan 15, 2024
1 parent dba733c commit 478c1ef
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions bin/varnishd/cache/cache_backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ vbe_connwait_signal_locked(struct backend *bp)
if (bp->n_conn < bp->max_connections) {
cw = VTAILQ_FIRST(&bp->cw_head);
if (cw != NULL)
AZ(pthread_cond_signal(&cw->cw_cond));
PTOK(pthread_cond_signal(&cw->cw_cond));
}
}

Expand Down Expand Up @@ -175,7 +175,7 @@ vbe_dir_getfd(VRT_CTX, struct worker *wrk, VCL_BACKEND dir, struct backend *bp,
return (NULL);
}

AZ(pthread_cond_init(&cw->cw_cond, NULL));
PTOK(pthread_cond_init(&cw->cw_cond, NULL));
Lck_Lock(bp->director->mtx);
cw_state = CW_DO_CONNECT;
if (!VTAILQ_EMPTY(&bp->cw_head) || BE_BUSY(bp)) {
Expand Down Expand Up @@ -209,7 +209,7 @@ vbe_dir_getfd(VRT_CTX, struct worker *wrk, VCL_BACKEND dir, struct backend *bp,
"backend %s: busy", VRT_BACKEND_string(dir));
bp->vsc->busy++;
VSC_C_main->backend_busy++;
AZ(pthread_cond_destroy(&cw->cw_cond));
PTOK(pthread_cond_destroy(&cw->cw_cond));
return (NULL);
}

Expand All @@ -224,7 +224,7 @@ vbe_dir_getfd(VRT_CTX, struct worker *wrk, VCL_BACKEND dir, struct backend *bp,
vbe_connwait_signal_locked(bp);
Lck_Unlock(bp->director->mtx);
}
AZ(pthread_cond_destroy(&cw->cw_cond));
PTOK(pthread_cond_destroy(&cw->cw_cond));
return (NULL);
}
bo->htc->doclose = SC_NULL;
Expand All @@ -247,7 +247,7 @@ vbe_dir_getfd(VRT_CTX, struct worker *wrk, VCL_BACKEND dir, struct backend *bp,
vbe_connwait_signal_locked(bp);
Lck_Unlock(bp->director->mtx);
}
AZ(pthread_cond_destroy(&cw->cw_cond));
PTOK(pthread_cond_destroy(&cw->cw_cond));
return (NULL);
}

Expand Down Expand Up @@ -287,7 +287,7 @@ vbe_dir_getfd(VRT_CTX, struct worker *wrk, VCL_BACKEND dir, struct backend *bp,
bp->vsc->conn--;
bp->vsc->req--;
Lck_Unlock(bp->director->mtx);
AZ(pthread_cond_destroy(&cw->cw_cond));
PTOK(pthread_cond_destroy(&cw->cw_cond));
return (NULL);
}
bo->acct.bereq_hdrbytes += err;
Expand All @@ -306,7 +306,7 @@ vbe_dir_getfd(VRT_CTX, struct worker *wrk, VCL_BACKEND dir, struct backend *bp,
bo->htc->first_byte_timeout, bo, bp);
FIND_TMO(between_bytes_timeout,
bo->htc->between_bytes_timeout, bo, bp);
AZ(pthread_cond_destroy(&cw->cw_cond));
PTOK(pthread_cond_destroy(&cw->cw_cond));
return (pfd);
}

Expand Down

0 comments on commit 478c1ef

Please sign in to comment.