From 8a1fe9caf207faaa0ae5c0ca13071c8bb7f9c004 Mon Sep 17 00:00:00 2001 From: zhengchao Date: Mon, 26 Nov 2018 18:41:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=94=80=E6=AF=81maat?= =?UTF-8?q?=E5=8F=A5=E6=9F=84=EF=BC=88Maat=5Fburn=5Ffeather=EF=BC=89?= =?UTF-8?q?=E6=97=B6=E6=B2=A1=E6=9C=89=E9=87=8A=E6=94=BEFieldStat=E5=8F=A5?= =?UTF-8?q?=E6=9F=84=E7=9A=84bug=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/entry/Maat_api.cpp | 6 ++++-- src/entry/Maat_rule.cpp | 4 ++++ src/inc_internal/Maat_rule_internal.h | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/entry/Maat_api.cpp b/src/entry/Maat_api.cpp index ca8a94c..1c582c7 100644 --- a/src/entry/Maat_api.cpp +++ b/src/entry/Maat_api.cpp @@ -813,8 +813,8 @@ int Maat_initiate_feather(Maat_feather_t feather) maat_stat_init(_feather); - pthread_t cfg_mon_t; - pthread_create(&cfg_mon_t, NULL, thread_rule_monitor, (void*)_feather); + + pthread_create(&(_feather->cfg_mon_t), NULL, thread_rule_monitor, (void*)_feather); return 0; } @@ -889,6 +889,8 @@ void Maat_burn_feather(Maat_feather_t feather) { struct _Maat_feather_t* _feather=(_Maat_feather_t*)feather; _feather->still_working=0;//destroy will proceed in thread_rule_monitor + void* ret=NULL; + pthread_join(_feather->cfg_mon_t, &ret); return; } int Maat_table_register(Maat_feather_t feather,const char* table_name) diff --git a/src/entry/Maat_rule.cpp b/src/entry/Maat_rule.cpp index 146fe14..f2ad2b7 100644 --- a/src/entry/Maat_rule.cpp +++ b/src/entry/Maat_rule.cpp @@ -3576,6 +3576,10 @@ void *thread_rule_monitor(void *arg) feather->redis_write_ctx=NULL; pthread_mutex_unlock(&(feather->redis_write_lock)); } + if(feather->stat_on&& feather->stat_handle) + { + FS_stop(&(feather->stat_handle)); + } free(feather); return NULL; } diff --git a/src/inc_internal/Maat_rule_internal.h b/src/inc_internal/Maat_rule_internal.h index b94273d..e57bfe0 100644 --- a/src/inc_internal/Maat_rule_internal.h +++ b/src/inc_internal/Maat_rule_internal.h @@ -415,6 +415,7 @@ struct _Maat_feather_t char group_tn[MAX_TABLE_NAME_LEN]; pthread_mutex_t backgroud_update_mutex; unsigned char decrypt_key[MAX_TABLE_NAME_LEN]; + pthread_t cfg_mon_t; char redis_ip[MAX_TABLE_NAME_LEN]; int redis_port;