diff options
author | Constantin Shalnev <c.shalnev@corp.mail.ru> | 2015-08-07 14:01:43 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:59:45 +0300 |
commit | 6b2e9a12d7baf4fca7d31670e050148759b8360b (patch) | |
tree | b14b6f4e8eb31452ae9c0f9bc355b3f469e70518 /map/framework.cpp | |
parent | 6b79a2d27c7b11eb3ab6a7427a8cd6658826332f (diff) |
Added thread checkers for routing
Diffstat (limited to 'map/framework.cpp')
-rw-r--r-- | map/framework.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/map/framework.cpp b/map/framework.cpp index b865277175..592a05f359 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -2109,6 +2109,8 @@ void Framework::UpdateSavedDataVersion() void Framework::BuildRoute(m2::PointD const & destination, uint32_t timeoutSec) { + ASSERT(m_threadChecker.CalledOnOriginalThread(), ("BuildRoute")); + shared_ptr<State> const & state = GetLocationState(); if (!state->IsModeHasPosition()) { @@ -2124,6 +2126,8 @@ void Framework::BuildRoute(m2::PointD const & destination, uint32_t timeoutSec) auto readyCallback = [this](Route const & route, IRouter::ResultCode code) { + ASSERT(m_threadChecker.CalledOnOriginalThread(), ("BuildRoute_ReadyCallback")); + vector<storage::TIndex> absentCountries; vector<storage::TIndex> absentRoutingIndexes; if (code == IRouter::NoError) @@ -2159,6 +2163,8 @@ void Framework::BuildRoute(m2::PointD const & destination, uint32_t timeoutSec) void Framework::SetRouter(RouterType type) { + ASSERT(m_threadChecker.CalledOnOriginalThread(), ("SetRouter")); + if (m_currentRouterType == type) return; SetRouterImpl(type); @@ -2202,6 +2208,8 @@ void Framework::SetRouterImpl(RouterType type) void Framework::RemoveRoute() { + ASSERT(m_threadChecker.CalledOnOriginalThread(), ("RemoveRoute")); + m_bmManager.UserMarksClear(UserMarkContainer::DEBUG_MARK); m_bmManager.ResetRouteTrack(); @@ -2209,6 +2217,8 @@ void Framework::RemoveRoute() void Framework::CloseRouting() { + ASSERT(m_threadChecker.CalledOnOriginalThread(), ("CloseRouting")); + GetLocationState()->StopRoutingMode(); m_routingSession.Reset(); RemoveRoute(); @@ -2217,6 +2227,8 @@ void Framework::CloseRouting() void Framework::InsertRoute(Route const & route) { + ASSERT(m_threadChecker.CalledOnOriginalThread(), ("InsertRoute")); + if (route.GetPoly().GetSize() < 2) { LOG(LWARNING, ("Invalid track - only", route.GetPoly().GetSize(), "point(s).")); |