summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/components/policy/policy_external/include/policy/policy_manager_impl.h5
-rw-r--r--src/components/policy/policy_external/src/policy_manager_impl.cc3
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_manager_impl.h5
-rw-r--r--src/components/policy/policy_regular/src/policy_manager_impl.cc3
4 files changed, 16 insertions, 0 deletions
diff --git a/src/components/policy/policy_external/include/policy/policy_manager_impl.h b/src/components/policy/policy_external/include/policy/policy_manager_impl.h
index 7822cc26f6..720f2e590f 100644
--- a/src/components/policy/policy_external/include/policy/policy_manager_impl.h
+++ b/src/components/policy/policy_external/include/policy/policy_manager_impl.h
@@ -1271,6 +1271,11 @@ class PolicyManagerImpl : public PolicyManager {
sync_primitives::Lock policy_table_lock_;
/**
+ * @brief lock guard for protecting policy table exchange
+ */
+ sync_primitives::Lock policy_table_exchange_lock_;
+
+ /**
* @brief lock guard for protecting application permissions access
*/
sync_primitives::Lock app_permissions_diff_lock_;
diff --git a/src/components/policy/policy_external/src/policy_manager_impl.cc b/src/components/policy/policy_external/src/policy_manager_impl.cc
index 60ab5a389e..1cf556946c 100644
--- a/src/components/policy/policy_external/src/policy_manager_impl.cc
+++ b/src/components/policy/policy_external/src/policy_manager_impl.cc
@@ -747,6 +747,9 @@ void PolicyManagerImpl::StartPTExchange() {
return;
}
+ sync_primitives::AutoLock policy_table_exchange_lock(
+ policy_table_exchange_lock_);
+
if (update_status_manager_.IsUpdatePending()) {
if (trigger_ptu_) {
update_status_manager_.ScheduleUpdate();
diff --git a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h
index 16ab9417bb..ac57738ca0 100644
--- a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h
+++ b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h
@@ -1108,6 +1108,11 @@ class PolicyManagerImpl : public PolicyManager {
sync_primitives::Lock policy_table_lock_;
/**
+ * @brief lock guard for protecting policy table exchange
+ */
+ sync_primitives::Lock policy_table_exchange_lock_;
+
+ /**
* @brief lock guard for protecting application permissions access
*/
sync_primitives::Lock app_permissions_diff_lock_;
diff --git a/src/components/policy/policy_regular/src/policy_manager_impl.cc b/src/components/policy/policy_regular/src/policy_manager_impl.cc
index ccc3454708..b80367b647 100644
--- a/src/components/policy/policy_regular/src/policy_manager_impl.cc
+++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc
@@ -629,6 +629,9 @@ void PolicyManagerImpl::StartPTExchange() {
return;
}
+ sync_primitives::AutoLock policy_table_exchange_lock(
+ policy_table_exchange_lock_);
+
if (update_status_manager_.IsUpdatePending() && update_required) {
if (trigger_ptu_)
update_status_manager_.ScheduleUpdate();