From ab2b23a553acc63427f9c39e31b4cdc16317982f Mon Sep 17 00:00:00 2001 From: Ira Lytvynenko Date: Wed, 31 May 2017 13:12:58 +0300 Subject: Rename 'this_lock_' to 'pending_requests_lock_' --- .../include/application_manager/request_info.h | 3 +-- src/components/application_manager/src/request_info.cc | 14 +++++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/components/application_manager/include/application_manager/request_info.h b/src/components/application_manager/include/application_manager/request_info.h index 216eb86cc5..09e9b02180 100644 --- a/src/components/application_manager/include/application_manager/request_info.h +++ b/src/components/application_manager/include/application_manager/request_info.h @@ -254,8 +254,7 @@ class RequestInfoSet { TimeSortedRequestInfoSet time_sorted_pending_requests_; HashSortedRequestInfoSet hash_sorted_pending_requests_; - // the lock caled this_lock_, since the class represent collection by itself. - sync_primitives::Lock this_lock_; + sync_primitives::Lock pending_requests_lock_; }; /** diff --git a/src/components/application_manager/src/request_info.cc b/src/components/application_manager/src/request_info.cc index 6327315a24..a485a89b01 100644 --- a/src/components/application_manager/src/request_info.cc +++ b/src/components/application_manager/src/request_info.cc @@ -123,7 +123,7 @@ bool RequestInfoSet::Add(RequestInfoPtr request_info) { logger_, "Add request app_id = " << request_info->app_id() << "; corr_id = " << request_info->requestId()); - sync_primitives::AutoLock lock(this_lock_); + sync_primitives::AutoLock lock(pending_requests_lock_); CheckSetSizes(); const std::pair& insert_resilt = hash_sorted_pending_requests_.insert(request_info); @@ -154,7 +154,7 @@ RequestInfoPtr RequestInfoSet::Find(const uint32_t connection_key, utils::SharedPtr request_info_for_search( new FakeRequestInfo(connection_key, correlation_id)); - sync_primitives::AutoLock lock(this_lock_); + sync_primitives::AutoLock lock(pending_requests_lock_); HashSortedRequestInfoSet::iterator it = hash_sorted_pending_requests_.find(request_info_for_search); if (it != hash_sorted_pending_requests_.end()) { @@ -166,7 +166,7 @@ RequestInfoPtr RequestInfoSet::Find(const uint32_t connection_key, RequestInfoPtr RequestInfoSet::Front() { RequestInfoPtr result; - sync_primitives::AutoLock lock(this_lock_); + sync_primitives::AutoLock lock(pending_requests_lock_); TimeSortedRequestInfoSet::iterator it = time_sorted_pending_requests_.begin(); if (it != time_sorted_pending_requests_.end()) { result = *it; @@ -176,7 +176,7 @@ RequestInfoPtr RequestInfoSet::Front() { RequestInfoPtr RequestInfoSet::FrontWithNotNullTimeout() { LOG4CXX_AUTO_TRACE(logger_); - sync_primitives::AutoLock lock(this_lock_); + sync_primitives::AutoLock lock(pending_requests_lock_); RequestInfoPtr result; TimeSortedRequestInfoSet::iterator it = time_sorted_pending_requests_.begin(); while (it != time_sorted_pending_requests_.end()) { @@ -220,7 +220,7 @@ bool RequestInfoSet::Erase(const RequestInfoPtr request_info) { } bool RequestInfoSet::RemoveRequest(const RequestInfoPtr request_info) { - sync_primitives::AutoLock lock(this_lock_); + sync_primitives::AutoLock lock(pending_requests_lock_); return Erase(request_info); } @@ -229,7 +229,7 @@ uint32_t RequestInfoSet::RemoveRequests( LOG4CXX_AUTO_TRACE(logger_); uint32_t erased = 0; - sync_primitives::AutoLock lock(this_lock_); + sync_primitives::AutoLock lock(pending_requests_lock_); HashSortedRequestInfoSet::iterator it = std::find_if(hash_sorted_pending_requests_.begin(), hash_sorted_pending_requests_.end(), @@ -257,7 +257,7 @@ uint32_t RequestInfoSet::RemoveMobileRequests() { } const size_t RequestInfoSet::Size() { - sync_primitives::AutoLock lock(this_lock_); + sync_primitives::AutoLock lock(pending_requests_lock_); CheckSetSizes(); return time_sorted_pending_requests_.size(); } -- cgit v1.2.1