From f0193d91b766bd6258ea90d397376686ef54d14b Mon Sep 17 00:00:00 2001 From: Donat Zenichev Date: Thu, 30 Jul 2026 13:45:09 +0200 Subject: [PATCH] MT#65612 RegThread: consider `stop_requested()` on `run()` Check whether the thread was asked to be stopped, instead on infinitely cycling through the true statement, relying on the fact `getFactory4Di()` will always return a safe and valid pointer. Change-Id: Ibc27b725eaa2c183c50bff603f7d3115cdc57b3d --- apps/reg_agent/RegistrationAgent.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/reg_agent/RegistrationAgent.cpp b/apps/reg_agent/RegistrationAgent.cpp index 531e9b19..a02dc25d 100644 --- a/apps/reg_agent/RegistrationAgent.cpp +++ b/apps/reg_agent/RegistrationAgent.cpp @@ -183,7 +183,7 @@ void RegThread::run() { /* wait for sems to completely start up */ sleep(2); - while (true) + while (!stop_requested()) { for (vector::iterator it = registrations.begin(); it != registrations.end(); @@ -201,7 +201,7 @@ void RegThread::run() { } void RegThread::on_stop() { - DBG("not stopping...\n"); + DBG("stopping reg_agent thread.\n"); } void RegThread::postEvent(AmEvent* ev) {