summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank <fronneburg@xevo.com>2017-12-13 11:59:09 -0800
committerFrank <fronneburg@xevo.com>2017-12-13 11:59:09 -0800
commitac8d45fa4218228dadb5a402a8cd88edf7617f52 (patch)
tree684bb74b14e185310a6e243217251a2312d55b30
parent0b19cf498d1c9972d67b85793dc6b029c26378a0 (diff)
downloadsdl_core-ac8d45fa4218228dadb5a402a8cd88edf7617f52.tar.gz
protect access to ResumptionDataJson during state save
-rw-r--r--src/components/application_manager/src/resumption/resumption_data_json.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/components/application_manager/src/resumption/resumption_data_json.cc b/src/components/application_manager/src/resumption/resumption_data_json.cc
index 7866fc4de1..2b7ac31b56 100644
--- a/src/components/application_manager/src/resumption/resumption_data_json.cc
+++ b/src/components/application_manager/src/resumption/resumption_data_json.cc
@@ -480,6 +480,9 @@ bool ResumptionDataJson::DropAppDataResumption(const std::string& device_id,
}
void ResumptionDataJson::Persist() {
+ // We lock the resumption data because SaveStateToFileSystem accesses
+ // the same dictionary that we use here in ResumptionDataJson
+ sync_primitives::AutoLock autolock(resumption_lock_);
last_state().SaveStateToFileSystem();
}