src/utils/blockQueue.c
//return 1 if full, 0 if success
return 1 if full, 0 if success
return 1 if full 0 if success
int bq_push(blockQueue *bq, http_req_t *http_req) {
    uv_mutex_lock(bq->mutex);
    if (test_full(bq)) {
        uv_mutex_unlock(bq->mutex);
        return 1;
    }
    bq->http_req_array[bq->tail] = http_req;
    bq->tail++;
    if (bq->tail == bq->max_size) {
        bq->tail = 0;
        bq->tail_ahead = 1;
    }
    uv_mutex_unlock(bq->mutex);
    uv_cond_signal(bq->cond);
    return 0;
}
int bq_push ( blockQueue * bq , http_req_t * http_req ) { uv_mutex_lock ( bq -> mutex ) ; if ( test_full ( bq ) ) { uv_mutex_unlock ( bq -> mutex ) ; return 1 ; } bq -> http_req_array [ bq -> tail ] = http_req ; bq -> tail ++ ; if ( bq -> tail == bq -> max_size ) { bq -> tail = 0 ; bq -> tail_ahead = 1 ; } uv_mutex_unlock ( bq -> mutex ) ; uv_cond_signal ( bq -> cond ) ; return 0 ; }
return 1 if full, 0 if success
return 1 if full 0 if success
// drop if full //signal we have one new element