summaryrefslogtreecommitdiffstats
path: root/daemon/main.h
diff options
context:
space:
mode:
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);