|
@@ -37,14 +37,14 @@
|
|
|
|
|
|
/* core list management */
|
|
|
|
|
|
-static int stream_list_empty(grpc_chttp2_transport *t,
|
|
|
- grpc_chttp2_stream_list_id id) {
|
|
|
+static bool stream_list_empty(grpc_chttp2_transport *t,
|
|
|
+ grpc_chttp2_stream_list_id id) {
|
|
|
return t->lists[id].head == NULL;
|
|
|
}
|
|
|
|
|
|
-static int stream_list_pop(grpc_chttp2_transport *t,
|
|
|
- grpc_chttp2_stream **stream,
|
|
|
- grpc_chttp2_stream_list_id id) {
|
|
|
+static bool stream_list_pop(grpc_chttp2_transport *t,
|
|
|
+ grpc_chttp2_stream **stream,
|
|
|
+ grpc_chttp2_stream_list_id id) {
|
|
|
grpc_chttp2_stream *s = t->lists[id].head;
|
|
|
if (s) {
|
|
|
grpc_chttp2_stream *new_head = s->links[id].next;
|
|
@@ -124,8 +124,8 @@ bool grpc_chttp2_list_add_writable_stream(grpc_chttp2_transport *t,
|
|
|
return stream_list_add(t, s, GRPC_CHTTP2_LIST_WRITABLE);
|
|
|
}
|
|
|
|
|
|
-int grpc_chttp2_list_pop_writable_stream(grpc_chttp2_transport *t,
|
|
|
- grpc_chttp2_stream **s) {
|
|
|
+bool grpc_chttp2_list_pop_writable_stream(grpc_chttp2_transport *t,
|
|
|
+ grpc_chttp2_stream **s) {
|
|
|
return stream_list_pop(t, s, GRPC_CHTTP2_LIST_WRITABLE);
|
|
|
}
|
|
|
|
|
@@ -139,12 +139,12 @@ bool grpc_chttp2_list_add_writing_stream(grpc_chttp2_transport *t,
|
|
|
return stream_list_add(t, s, GRPC_CHTTP2_LIST_WRITING);
|
|
|
}
|
|
|
|
|
|
-int grpc_chttp2_list_have_writing_streams(grpc_chttp2_transport *t) {
|
|
|
+bool grpc_chttp2_list_have_writing_streams(grpc_chttp2_transport *t) {
|
|
|
return !stream_list_empty(t, GRPC_CHTTP2_LIST_WRITING);
|
|
|
}
|
|
|
|
|
|
-int grpc_chttp2_list_pop_writing_stream(grpc_chttp2_transport *t,
|
|
|
- grpc_chttp2_stream **s) {
|
|
|
+bool grpc_chttp2_list_pop_writing_stream(grpc_chttp2_transport *t,
|
|
|
+ grpc_chttp2_stream **s) {
|
|
|
return stream_list_pop(t, s, GRPC_CHTTP2_LIST_WRITING);
|
|
|
}
|
|
|
|
|
@@ -153,8 +153,8 @@ void grpc_chttp2_list_add_waiting_for_concurrency(grpc_chttp2_transport *t,
|
|
|
stream_list_add(t, s, GRPC_CHTTP2_LIST_WAITING_FOR_CONCURRENCY);
|
|
|
}
|
|
|
|
|
|
-int grpc_chttp2_list_pop_waiting_for_concurrency(grpc_chttp2_transport *t,
|
|
|
- grpc_chttp2_stream **s) {
|
|
|
+bool grpc_chttp2_list_pop_waiting_for_concurrency(grpc_chttp2_transport *t,
|
|
|
+ grpc_chttp2_stream **s) {
|
|
|
return stream_list_pop(t, s, GRPC_CHTTP2_LIST_WAITING_FOR_CONCURRENCY);
|
|
|
}
|
|
|
|
|
@@ -163,8 +163,8 @@ void grpc_chttp2_list_add_stalled_by_transport(grpc_chttp2_transport *t,
|
|
|
stream_list_add(t, s, GRPC_CHTTP2_LIST_STALLED_BY_TRANSPORT);
|
|
|
}
|
|
|
|
|
|
-int grpc_chttp2_list_pop_stalled_by_transport(grpc_chttp2_transport *t,
|
|
|
- grpc_chttp2_stream **s) {
|
|
|
+bool grpc_chttp2_list_pop_stalled_by_transport(grpc_chttp2_transport *t,
|
|
|
+ grpc_chttp2_stream **s) {
|
|
|
return stream_list_pop(t, s, GRPC_CHTTP2_LIST_STALLED_BY_TRANSPORT);
|
|
|
}
|
|
|
|
|
@@ -172,3 +172,18 @@ void grpc_chttp2_list_remove_stalled_by_transport(grpc_chttp2_transport *t,
|
|
|
grpc_chttp2_stream *s) {
|
|
|
stream_list_maybe_remove(t, s, GRPC_CHTTP2_LIST_STALLED_BY_TRANSPORT);
|
|
|
}
|
|
|
+
|
|
|
+void grpc_chttp2_list_add_stalled_by_stream(grpc_chttp2_transport *t,
|
|
|
+ grpc_chttp2_stream *s) {
|
|
|
+ stream_list_add(t, s, GRPC_CHTTP2_LIST_STALLED_BY_STREAM);
|
|
|
+}
|
|
|
+
|
|
|
+bool grpc_chttp2_list_pop_stalled_by_stream(grpc_chttp2_transport *t,
|
|
|
+ grpc_chttp2_stream **s) {
|
|
|
+ return stream_list_pop(t, s, GRPC_CHTTP2_LIST_STALLED_BY_STREAM);
|
|
|
+}
|
|
|
+
|
|
|
+bool grpc_chttp2_list_remove_stalled_by_stream(grpc_chttp2_transport *t,
|
|
|
+ grpc_chttp2_stream *s) {
|
|
|
+ return stream_list_maybe_remove(t, s, GRPC_CHTTP2_LIST_STALLED_BY_STREAM);
|
|
|
+}
|