[traffic] Remove mwms from ThreadRoutine()

Signed-off-by: mvglasow <michael -at- vonglasow.com>
This commit is contained in:
mvglasow
2025-05-17 17:48:07 +03:00
parent 18f1dfac45
commit 52a915211e
2 changed files with 4 additions and 5 deletions

View File

@@ -629,8 +629,7 @@ void TrafficManager::ThreadRoutine()
m_lastDrapeUpdate = steady_clock::now(); m_lastDrapeUpdate = steady_clock::now();
m_lastObserverUpdate = steady_clock::now(); m_lastObserverUpdate = steady_clock::now();
std::vector<MwmSet::MwmId> mwms; while (WaitForRequest())
while (WaitForRequest(mwms))
{ {
// TODO clean out expired messages // TODO clean out expired messages
@@ -698,14 +697,14 @@ void TrafficManager::ThreadRoutine()
m_trafficETags[mwm] = tag; m_trafficETags[mwm] = tag;
} }
} }
#endif
mwms.clear(); mwms.clear();
#endif
} }
// Calling Unsubscribe() form the worker thread on exit makes thread synchronization easier // Calling Unsubscribe() form the worker thread on exit makes thread synchronization easier
Unsubscribe(); Unsubscribe();
} }
bool TrafficManager::WaitForRequest(std::vector<MwmSet::MwmId> & mwms) bool TrafficManager::WaitForRequest()
{ {
std::unique_lock<std::mutex> lock(m_mutex); std::unique_lock<std::mutex> lock(m_mutex);

View File

@@ -289,7 +289,7 @@ private:
* @return `true` during normal operation, `false` during teardown (signaling the event loop to exit). * @return `true` during normal operation, `false` during teardown (signaling the event loop to exit).
*/ */
// TODO mwms argument is no longer needed // TODO mwms argument is no longer needed
bool WaitForRequest(std::vector<MwmSet::MwmId> & mwms); bool WaitForRequest();
/** /**
* @brief Processes new traffic data. * @brief Processes new traffic data.