From 52a915211e8f7332bb2fbde1e77c3432050331f3 Mon Sep 17 00:00:00 2001 From: mvglasow Date: Sat, 17 May 2025 17:48:07 +0300 Subject: [PATCH] [traffic] Remove mwms from ThreadRoutine() Signed-off-by: mvglasow --- map/traffic_manager.cpp | 7 +++---- map/traffic_manager.hpp | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/map/traffic_manager.cpp b/map/traffic_manager.cpp index adfac2118..47a6799f7 100644 --- a/map/traffic_manager.cpp +++ b/map/traffic_manager.cpp @@ -629,8 +629,7 @@ void TrafficManager::ThreadRoutine() m_lastDrapeUpdate = steady_clock::now(); m_lastObserverUpdate = steady_clock::now(); - std::vector mwms; - while (WaitForRequest(mwms)) + while (WaitForRequest()) { // TODO clean out expired messages @@ -698,14 +697,14 @@ void TrafficManager::ThreadRoutine() m_trafficETags[mwm] = tag; } } -#endif mwms.clear(); +#endif } // Calling Unsubscribe() form the worker thread on exit makes thread synchronization easier Unsubscribe(); } -bool TrafficManager::WaitForRequest(std::vector & mwms) +bool TrafficManager::WaitForRequest() { std::unique_lock lock(m_mutex); diff --git a/map/traffic_manager.hpp b/map/traffic_manager.hpp index 3cfd5f0db..71b87e945 100644 --- a/map/traffic_manager.hpp +++ b/map/traffic_manager.hpp @@ -289,7 +289,7 @@ private: * @return `true` during normal operation, `false` during teardown (signaling the event loop to exit). */ // TODO mwms argument is no longer needed - bool WaitForRequest(std::vector & mwms); + bool WaitForRequest(); /** * @brief Processes new traffic data.