#define CLEANUP_EVERY_EVENTS 100
void *socket_listen_main_multi_threaded(void *ptr) {
- (void)ptr;
+ struct netdata_static_thread *static_thread = (struct netdata_static_thread *)ptr;
web_server_mode = WEB_SERVER_MODE_MULTI_THREADED;
info("Multi-threaded WEB SERVER thread created with task id %d", gettid());
debug(D_WEB_CLIENT, "LISTENER: exit!");
close_listen_sockets();
+ static_thread->enabled = 0;
+ static_thread->thread = NULL;
+ pthread_exit(NULL);
return NULL;
}
}
void *socket_listen_main_single_threaded(void *ptr) {
- (void)ptr;
+ struct netdata_static_thread *static_thread = (struct netdata_static_thread *)ptr;
web_server_mode = WEB_SERVER_MODE_SINGLE_THREADED;
debug(D_WEB_CLIENT, "LISTENER: exit!");
close_listen_sockets();
+
+ static_thread->enabled = 0;
+ static_thread->thread = NULL;
+ pthread_exit(NULL);
return NULL;
}