From 431824a007950da26ad923b9939734cef6ca164c Mon Sep 17 00:00:00 2001 From: Zxilly Date: Wed, 19 Jun 2024 02:31:41 +0800 Subject: [PATCH] chore: detach cleanup thread --- src/cache.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/cache.c b/src/cache.c index 60828f78..6fdef229 100644 --- a/src/cache.c +++ b/src/cache.c @@ -5,10 +5,13 @@ #include #include #include +#include +#include +#include pthread_rwlock_t cacheLock; -struct cache *not_http_dst_cache; +struct cache *not_http_dst_cache = NULL; static int check_interval; _Noreturn static void check_cache() { @@ -47,6 +50,8 @@ void init_not_http_cache(const int interval) { exit(EXIT_FAILURE); } syslog(LOG_INFO, "Cleanup thread created"); + + pthread_detach(cleanup_thread); } bool cache_contains(struct addr_port target) {