aboutsummaryrefslogtreecommitdiff
path: root/src/core/stats.h
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2019-12-29 14:39:27 -0800
committerGarrett D'Amore <garrett@damore.org>2019-12-29 15:21:42 -0800
commitb4d3ff2d460607ba8e1b351233cb6cbe9f031264 (patch)
tree74a9aba0717f74404438bbca1bdc75a9e6105abf /src/core/stats.h
parente457590015f8c3f4e840e4bed290f052c001e07c (diff)
downloadnng-b4d3ff2d460607ba8e1b351233cb6cbe9f031264.tar.gz
nng-b4d3ff2d460607ba8e1b351233cb6cbe9f031264.tar.bz2
nng-b4d3ff2d460607ba8e1b351233cb6cbe9f031264.zip
fixes #1064 Potential deadlock in statistics code
fixes #1063 Include sanitizer runs in CI fixes #1068 Wssfile test sometimes fails with wrong error code While here, addressed a number of clang-tidy items, and some light cleanup of code we were already in.
Diffstat (limited to 'src/core/stats.h')
-rw-r--r--src/core/stats.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/core/stats.h b/src/core/stats.h
index 215e07d8..12dbbbdd 100644
--- a/src/core/stats.h
+++ b/src/core/stats.h
@@ -54,8 +54,16 @@ struct nni_stat_item {
#endif
};
-void nni_stat_append(nni_stat_item *, nni_stat_item *);
-void nni_stat_remove(nni_stat_item *);
+// nni_stat_add adds a statistic, but the operation is unlocked, and the
+// add is to an unregistered stats tree.
+void nni_stat_add(nni_stat_item *, nni_stat_item *);
+
+// nni_stat_register registers a statistic tree into the global tree.
+// The tree is rooted at the root. This is a locked operation.
+void nni_stat_register(nni_stat_item *);
+
+// nni_stat_unregister removes the entire tree. This is a locked operation.
+void nni_stat_unregister(nni_stat_item *);
void nni_stat_set_value(nni_stat_item *, uint64_t);
void nni_stat_set_string(nni_stat_item *, const char *);