diff options
Diffstat (limited to '')
-rw-r--r-- | src/libnetdata/threads/README.md | 12 | ||||
-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); |