diff --git a/apps/db_reg_agent/DBRegAgent.cpp b/apps/db_reg_agent/DBRegAgent.cpp index 8d917102..aa878254 100644 --- a/apps/db_reg_agent/DBRegAgent.cpp +++ b/apps/db_reg_agent/DBRegAgent.cpp @@ -550,6 +550,7 @@ void DBRegAgent::process(AmEvent* ev) { DBG("Session received system Event\n"); if (sys_ev->sys_event == AmSystemEvent::ServerShutdown) { running = false; + registration_scheduler._timer_thread_running = false; } return; } diff --git a/apps/db_reg_agent/RegistrationTimer.cpp b/apps/db_reg_agent/RegistrationTimer.cpp index ff740319..dcd3e546 100644 --- a/apps/db_reg_agent/RegistrationTimer.cpp +++ b/apps/db_reg_agent/RegistrationTimer.cpp @@ -203,7 +203,9 @@ void RegistrationTimer::run() gettimeofday(&now, NULL); timeradd(&tick,&now,&next_tick); - while(true){ + _timer_thread_running = true; + + while(_timer_thread_running){ gettimeofday(&now,NULL); diff --git a/apps/db_reg_agent/RegistrationTimer.h b/apps/db_reg_agent/RegistrationTimer.h index 14e2b9ab..27eb0728 100644 --- a/apps/db_reg_agent/RegistrationTimer.h +++ b/apps/db_reg_agent/RegistrationTimer.h @@ -108,6 +108,7 @@ class RegistrationTimer time_t to_time); RegistrationTimer(); + bool _timer_thread_running; }; #endif