Lines Matching defs:tnode
45 void nghttp3_tnode_init(nghttp3_tnode *tnode, const nghttp3_node_id *nid,
49 tnode->pe.index = NGHTTP3_PQ_BAD_INDEX;
50 tnode->nid = *nid;
51 tnode->seq = seq;
52 tnode->cycle = 0;
53 tnode->pri = pri;
56 void nghttp3_tnode_free(nghttp3_tnode *tnode) { (void)tnode; }
58 static void tnode_unschedule(nghttp3_tnode *tnode, nghttp3_pq *pq) {
59 assert(tnode->pe.index != NGHTTP3_PQ_BAD_INDEX);
61 nghttp3_pq_remove(pq, &tnode->pe);
62 tnode->pe.index = NGHTTP3_PQ_BAD_INDEX;
65 void nghttp3_tnode_unschedule(nghttp3_tnode *tnode, nghttp3_pq *pq) {
66 if (tnode->pe.index == NGHTTP3_PQ_BAD_INDEX) {
70 tnode_unschedule(tnode, pq);
84 int nghttp3_tnode_schedule(nghttp3_tnode *tnode, nghttp3_pq *pq,
88 if (tnode->pe.index == NGHTTP3_PQ_BAD_INDEX) {
89 tnode->cycle = pq_get_first_cycle(pq) +
90 ((nwrite == 0 || !nghttp3_pri_uint8_inc(tnode->pri))
94 if (!nghttp3_pri_uint8_inc(tnode->pri) || nghttp3_pq_size(pq) == 1) {
98 nghttp3_pq_remove(pq, &tnode->pe);
99 tnode->pe.index = NGHTTP3_PQ_BAD_INDEX;
100 tnode->cycle += nghttp3_max(1, penalty);
105 return nghttp3_pq_push(pq, &tnode->pe);
108 int nghttp3_tnode_is_scheduled(nghttp3_tnode *tnode) {
109 return tnode->pe.index != NGHTTP3_PQ_BAD_INDEX;