MCPcopy Create free account
hub / github.com/comaps/comaps / OnTaskFinished

Method OnTaskFinished

libs/drape_frontend/read_manager.cpp:84–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84void ReadManager::OnTaskFinished(threads::IRoutine * task)
85{
86 ASSERT(dynamic_cast<ReadMWMTask *>(task) != NULL, ());
87 auto t = static_cast<ReadMWMTask *>(task);
88
89 // finish tiles
90 {
91 std::lock_guard lock(m_finishedTilesMutex);
92
93 // decrement counter
94 ASSERT_GREATER(m_counter, 0, ());
95 if (--m_counter == 0)
96 {
97 m_commutator->PostMessage(ThreadsCommutator::ResourceUploadThread, make_unique_dp<FinishReadingMessage>(),
98 MessagePriority::Normal);
99 }
100
101 auto const & key = t->GetTileKey();
102 if (!task->IsCancelled())
103 {
104 auto const it = m_activeTiles.find(key);
105 ASSERT(it != m_activeTiles.end(), ());
106
107 // Use the tile key from active tiles with the actual user marks generation.
108 TTilesCollection tiles;
109 tiles.emplace(*it);
110
111 m_activeTiles.erase(it);
112
113 m_commutator->PostMessage(
114 ThreadsCommutator::ResourceUploadThread,
115 make_unique_dp<FinishTileReadMessage>(std::move(tiles), true /* forceUpdateUserMarks */),
116 MessagePriority::Normal);
117 }
118 }
119
120 t->Reset();
121 m_tasksPool.Return(t);
122}
123
124void ReadManager::UpdateCoverage(ScreenBase const & screen, bool have3dBuildings, bool forceUpdate,
125 bool forceUpdateUserMarks, TTilesCollection const & tiles,

Callers

nothing calls this directly

Calls 9

ASSERTFunction · 0.85
ReturnMethod · 0.80
PostMessageMethod · 0.45
IsCancelledMethod · 0.45
findMethod · 0.45
endMethod · 0.45
emplaceMethod · 0.45
eraseMethod · 0.45
ResetMethod · 0.45

Tested by

no test coverage detected