From 65ac23e0399284942ad1d41c6d9da65aa6481fc0 Mon Sep 17 00:00:00 2001 From: Donat Zenichev Date: Fri, 31 Jul 2026 12:14:58 +0200 Subject: [PATCH] MT#65612 RegThread: tighten the check registrations loop make the `run()` more accurately honor the threads stop request when checking registrations in the inner-loop. If the thread is on `wait_or_stop()` this should be managed just quickly and gracefully. However if we are on the `check_registration()` or `create_registration()` doing a DI cal, threads stop request cannot really interrupt it. So tighten it. Change-Id: I31ef44445817d4eb8e11cf269c2bd4db2eff71ef --- apps/reg_agent/RegistrationAgent.cpp | 2 +- apps/reg_agent/RegistrationAgent.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/reg_agent/RegistrationAgent.cpp b/apps/reg_agent/RegistrationAgent.cpp index b2eed4e5..91fd925d 100644 --- a/apps/reg_agent/RegistrationAgent.cpp +++ b/apps/reg_agent/RegistrationAgent.cpp @@ -206,7 +206,7 @@ void RegThread::run() { while (!stop_requested()) { for (vector::iterator it = registrations.begin(); - it != registrations.end(); + it != registrations.end() && !stop_requested(); it++) { if (!check_registration(*it)) { diff --git a/apps/reg_agent/RegistrationAgent.h b/apps/reg_agent/RegistrationAgent.h index 1505e54e..630eb41d 100644 --- a/apps/reg_agent/RegistrationAgent.h +++ b/apps/reg_agent/RegistrationAgent.h @@ -77,7 +77,9 @@ class RegistrationAgentFactory: public AmSessionFactory /* makes the thread stop as soon as the app factory begins its destruction */ DBG("Requested the reg agent thread to stop.\n"); dialer.stop(); + INFO("Joining reg_agent thread...\n"); dialer.join(); + INFO("reg_agent thread joined.\n"); } int onLoad();