]> arthur.barton.de Git - netdata.git/blobdiff - src/plugin_proc.c
improved netdata cleanup/exit procedure
[netdata.git] / src / plugin_proc.c
index 9b99d82e1d15a79bbd762a38266f924c65683340..e20cbd3660cb3d24f00ad91be03204a5603524cd 100644 (file)
@@ -56,9 +56,8 @@ static struct proc_module {
         { .name = NULL, .dim = NULL, .func = NULL }
 };
 
-void *proc_main(void *ptr)
-{
-    (void)ptr;
+void *proc_main(void *ptr) {
+    struct netdata_static_thread *static_thread = (struct netdata_static_thread *)ptr;
 
     info("PROC Plugin thread created with task id %d", gettid());
 
@@ -140,6 +139,8 @@ void *proc_main(void *ptr)
 
     info("PROC thread exiting");
 
+    static_thread->enabled = 0;
+    static_thread->thread = NULL;
     pthread_exit(NULL);
     return NULL;
 }