From f1ed22025853ad03a9401007f32fb13c21e375fb Mon Sep 17 00:00:00 2001 From: Vladimir Byko-Ianko Date: Wed, 14 Mar 2018 11:34:09 +0300 Subject: Review fixes. --- routing/routing_session.cpp | 6 +++--- routing/routing_session.hpp | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'routing') diff --git a/routing/routing_session.cpp b/routing/routing_session.cpp index 9d6b143bd2..d2879b71cc 100644 --- a/routing/routing_session.cpp +++ b/routing/routing_session.cpp @@ -173,7 +173,7 @@ void RoutingSession::RebuildRouteOnTrafficUpdate() threads::MutexGuard guard(m_routingSessionMutex); startPoint = m_lastGoodPosition; - switch (m_state.load()) + switch (m_state) { case RoutingNotActive: case RouteNotReady: @@ -567,7 +567,7 @@ traffic::SpeedGroup RoutingSession::MatchTraffic( bool RoutingSession::DisableFollowMode() { - LOG(LINFO, ("Routing disables a following mode. State: ", m_state.load())); + LOG(LINFO, ("Routing disables a following mode. State: ", m_state)); threads::MutexGuard guard(m_routingSessionMutex); if (m_state == RouteNotStarted || m_state == OnRoute) { @@ -580,7 +580,7 @@ bool RoutingSession::DisableFollowMode() bool RoutingSession::EnableFollowMode() { - LOG(LINFO, ("Routing enables a following mode. State: ", m_state.load())); + LOG(LINFO, ("Routing enables a following mode. State: ", m_state)); threads::MutexGuard guard(m_routingSessionMutex); if (m_state == RouteNotStarted || m_state == OnRoute) { diff --git a/routing/routing_session.hpp b/routing/routing_session.hpp index cfa179e91a..cdedf6e146 100644 --- a/routing/routing_session.hpp +++ b/routing/routing_session.hpp @@ -20,7 +20,6 @@ #include "base/mutex.hpp" -#include "std/atomic.hpp" #include "std/functional.hpp" #include "std/limits.hpp" #include "std/map.hpp" @@ -215,8 +214,8 @@ private: private: unique_ptr m_router; shared_ptr m_route; - atomic m_state; - atomic m_isFollowing; + State m_state; + bool m_isFollowing; Checkpoints m_checkpoints; size_t m_lastWarnedSpeedCameraIndex; SpeedCameraRestriction m_lastFoundCamera; @@ -228,7 +227,7 @@ private: /// about camera will be sent at most once. mutable bool m_speedWarningSignal; - /// |m_routingSessionMutex| should be used for access to |m_route| member. + /// |m_routingSessionMutex| should be used for access to all members of RoutingSession class. mutable threads::Mutex m_routingSessionMutex; /// Current position metrics to check for RouteNeedRebuild state. -- cgit v1.2.3