summaryrefslogtreecommitdiffstats
path: root/src/libnetdata/threads
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 12:08:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 12:08:18 +0000
commit5da14042f70711ea5cf66e034699730335462f66 (patch)
tree0f6354ccac934ed87a2d555f45be4c831cf92f4a /src/libnetdata/threads
parentReleasing debian version 1.44.3-2. (diff)
downloadnetdata-5da14042f70711ea5cf66e034699730335462f66.tar.xz
netdata-5da14042f70711ea5cf66e034699730335462f66.zip
Merging upstream version 1.45.3+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--src/libnetdata/threads/README.md12
-rw-r--r--src/libnetdata/threads/threads.c (renamed from libnetdata/threads/threads.c)5
-rw-r--r--src/libnetdata/threads/threads.h (renamed from libnetdata/threads/threads.h)4
3 files changed, 19 insertions, 2 deletions
diff --git a/src/libnetdata/threads/README.md b/src/libnetdata/threads/README.md
new file mode 100644
index 000000000..906f47952
--- /dev/null
+++ b/src/libnetdata/threads/README.md
@@ -0,0 +1,12 @@
+<!--
+title: Threads
+custom_edit_url: https://github.com/netdata/netdata/edit/master/src/libnetdata/threads/README.md
+sidebar_label: "Threads"
+learn_status: "Published"
+learn_topic_type: "Tasks"
+learn_rel_path: "Developers/libnetdata"
+-->
+
+# Threads
+
+Netdata uses a custom threads library
diff --git a/libnetdata/threads/threads.c b/src/libnetdata/threads/threads.c
index c14f9a7eb..94761671a 100644
--- a/libnetdata/threads/threads.c
+++ b/src/libnetdata/threads/threads.c
@@ -281,8 +281,9 @@ static void *netdata_thread_init(void *ptr) {
}
void *ret = NULL;
- pthread_cleanup_push(thread_cleanup, ptr);
- ret = netdata_thread->start_routine(netdata_thread->arg);
+ pthread_cleanup_push(thread_cleanup, ptr) {
+ ret = netdata_thread->start_routine(netdata_thread->arg);
+ }
pthread_cleanup_pop(1);
return ret;
diff --git a/libnetdata/threads/threads.h b/src/libnetdata/threads/threads.h
index 97c3c8036..4f1d06f00 100644
--- a/libnetdata/threads/threads.h
+++ b/src/libnetdata/threads/threads.h
@@ -59,6 +59,10 @@ struct netdata_static_thread {
const char *netdata_thread_tag(void);
int netdata_thread_tag_exists(void);
+#define THREAD_TAG_STREAM_RECEIVER "RCVR"
+#define THREAD_TAG_STREAM_SENDER "SNDR"
+
+
size_t netdata_threads_init(void);
void netdata_threads_init_after_fork(size_t stacksize);
void netdata_threads_init_for_external_plugins(size_t stacksize);