summaryrefslogtreecommitdiffstats
path: root/src/global_statistics.c
diff options
context:
space:
mode:
authorFederico Ceratto <federico.ceratto@gmail.com>2016-03-30 21:40:42 +0000
committerFederico Ceratto <federico.ceratto@gmail.com>2016-03-30 21:40:42 +0000
commit9ce153ce7167c11adba8ac225edc7a707e97c6eb (patch)
tree9f6e849cce2dcc7e5b4e9e6252c843dc2d0787a2 /src/global_statistics.c
downloadnetdata-9ce153ce7167c11adba8ac225edc7a707e97c6eb.tar.xz
netdata-9ce153ce7167c11adba8ac225edc7a707e97c6eb.zip
Imported Upstream version 1.0.0upstream/1.0.0
Diffstat (limited to 'src/global_statistics.c')
-rwxr-xr-xsrc/global_statistics.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/global_statistics.c b/src/global_statistics.c
new file mode 100755
index 000000000..d4a04efd2
--- /dev/null
+++ b/src/global_statistics.c
@@ -0,0 +1,18 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include <pthread.h>
+
+#include "global_statistics.h"
+
+struct global_statistics global_statistics = { 0ULL, 0ULL, 0ULL, 0ULL };
+
+pthread_mutex_t global_statistics_mutex = PTHREAD_MUTEX_INITIALIZER;
+
+void global_statistics_lock(void) {
+ pthread_mutex_lock(&global_statistics_mutex);
+}
+
+void global_statistics_unlock(void) {
+ pthread_mutex_unlock(&global_statistics_mutex);
+}