summaryrefslogtreecommitdiffstats
path: root/daemon/main.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2018-11-07 12:19:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2018-11-07 12:20:17 +0000
commita64a253794ac64cb40befee54db53bde17dd0d49 (patch)
treec1024acc5f6e508814b944d99f112259bb28b1be /daemon/main.h
parentNew upstream version 1.10.0+dfsg (diff)
downloadnetdata-upstream/1.11.0+dfsg.tar.xz
netdata-upstream/1.11.0+dfsg.zip
New upstream version 1.11.0+dfsgupstream/1.11.0+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--daemon/main.h (renamed from src/main.h)20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/main.h b/daemon/main.h
index d29bf74e7..cb0bde6a9 100644
--- a/src/main.h
+++ b/daemon/main.h
@@ -1,6 +1,12 @@
+// SPDX-License-Identifier: GPL-3.0-or-later
+
#ifndef NETDATA_MAIN_H
#define NETDATA_MAIN_H 1
+#include "common.h"
+
+extern struct config netdata_config;
+
#define NETDATA_MAIN_THREAD_RUNNING CONFIG_BOOLEAN_YES
#define NETDATA_MAIN_THREAD_EXITING (CONFIG_BOOLEAN_YES + 1)
#define NETDATA_MAIN_THREAD_EXITED CONFIG_BOOLEAN_NO
@@ -21,17 +27,17 @@ struct option_def {
};
struct netdata_static_thread {
- char *name;
+ char *name; // the name of the thread as it should appear in the logs
- char *config_section;
- char *config_name;
+ char *config_section; // the section of netdata.conf to check if this is enabled or not
+ char *config_name; // the name of the config option to check if it is true or false
- volatile sig_atomic_t enabled;
+ volatile sig_atomic_t enabled; // the current status of the thread
- netdata_thread_t *thread;
+ netdata_thread_t *thread; // internal use, to maintain a pointer to the created thread
- void (*init_routine) (void);
- void *(*start_routine) (void *);
+ void (*init_routine) (void); // an initialization function to run before spawning the thread
+ void *(*start_routine) (void *); // the threaded worker
};
extern void cancel_main_threads(void);