Showing 1 of 1 files from the diff.

@@ -82,6 +82,7 @@
Loading
82 82
	nni_list             handlers;
83 83
	nni_list             conns;
84 84
	nni_mtx              mtx;
85 +
	nni_cv               cv;
85 86
	bool                 closed;
86 87
	nni_aio *            accaio;
87 88
	nng_stream_listener *listener;
@@ -294,6 +295,9 @@
Loading
294 295
	if (nni_list_node_active(&sc->node)) {
295 296
		nni_list_remove(&s->conns, sc);
296 297
	}
298 +
	if (nni_list_empty(&s->conns)) {
299 +
		nni_cv_wake(&s->cv);
300 +
	}
297 301
	nni_mtx_unlock(&s->mtx);
298 302
299 303
	NNI_FREE_STRUCT(sc);
@@ -916,6 +920,7 @@
Loading
916 920
	nni_mtx_fini(&s->errors_mtx);
917 921
918 922
	nni_aio_free(s->accaio);
923 +
	nni_cv_fini(&s->cv);
919 924
	nni_mtx_fini(&s->mtx);
920 925
	nni_strfree(s->hostname);
921 926
	NNI_FREE_STRUCT(s);
@@ -957,6 +962,7 @@
Loading
957 962
	}
958 963
	nni_mtx_init(&s->mtx);
959 964
	nni_mtx_init(&s->errors_mtx);
965 +
	nni_cv_init(&s->cv, &s->mtx);
960 966
	NNI_LIST_INIT(&s->handlers, nni_http_handler, node);
961 967
	NNI_LIST_INIT(&s->conns, http_sconn, node);
962 968
@@ -1069,6 +1075,10 @@
Loading
1069 1075
	NNI_LIST_FOREACH (&s->conns, sc) {
1070 1076
		http_sconn_close_locked(sc);
1071 1077
	}
1078 +
1079 +
	while (!nni_list_empty(&s->conns)) {
1080 +
		nni_cv_wait(&s->cv);
1081 +
	}
1072 1082
}
1073 1083
1074 1084
void
Files Coverage
src 80.58%
tools/nngcat/nngcat.c 56.33%
Project Totals (87 files) 79.81%
1
ignore:
2
 - "tests"
3
 - "perf"
4
 - "**/*_test.c"
5
coverage:
6
 range: 50..95
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading