From dc057b25627eff16e75205f8393decd0d1b9c9c2 Mon Sep 17 00:00:00 2001 From: zhengchao Date: Tue, 27 Jul 2021 11:54:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=8F=E5=B0=91=E5=A2=9E=E9=87=8F=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=97=B6hier=E9=87=8D=E5=BB=BA=E7=9A=84=E5=86=99?= =?UTF-8?q?=E9=94=81=E4=B8=B4=E7=95=8C=E5=8C=BA=EF=BC=8C=E5=87=8F=E5=B0=91?= =?UTF-8?q?=E6=89=AB=E6=8F=8F=E7=BA=BF=E7=A8=8B=E7=9A=84=E6=89=80=E5=86=B2?= =?UTF-8?q?=E7=AA=81=E3=80=82=20=E4=BF=AE=E5=A4=8D=20TSG-7211?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/entry/Maat_hierarchy.cpp | 15 +++++++-------- src/entry/Maat_rule.cpp | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/entry/Maat_hierarchy.cpp b/src/entry/Maat_hierarchy.cpp index be83188..dc1974a 100644 --- a/src/entry/Maat_hierarchy.cpp +++ b/src/entry/Maat_hierarchy.cpp @@ -1198,18 +1198,17 @@ int Maat_hierarchy_rebuild(struct Maat_hierarchy* hier) int ret=0; struct bool_matcher* new_bm=NULL, *old_bm=NULL; struct region2clause_value* new_region2clause_hash=NULL, *old_region2clause_hash=NULL; - + + //Read hier from update thread is OK. + ret=Maat_hierarchy_build_top_groups(hier); + new_bm=Maat_hierarchy_build_bool_matcher(hier); + new_region2clause_hash=Maat_hierarchy_build_region2clause_hash(hier); + pthread_rwlock_wrlock(&hier->rwlock); - ret=Maat_hierarchy_build_top_groups(hier); - - new_bm=Maat_hierarchy_build_bool_matcher(hier); - old_bm=hier->bm; - - new_region2clause_hash=Maat_hierarchy_build_region2clause_hash(hier); + old_bm=hier->bm; old_region2clause_hash=hier->hash_region2clause; - hier->bm=new_bm; hier->hash_region2clause=new_region2clause_hash; pthread_rwlock_unlock(&hier->rwlock); diff --git a/src/entry/Maat_rule.cpp b/src/entry/Maat_rule.cpp index fc36607..9e8bbc3 100644 --- a/src/entry/Maat_rule.cpp +++ b/src/entry/Maat_rule.cpp @@ -57,7 +57,7 @@ extern "C" } #endif -int MAAT_FRAME_VERSION_3_4_1_20210719=1; +int MAAT_FRAME_VERSION_3_4_3_20210727=1; int is_valid_table_name(const char* str) {