Module: sems
Branch: master
Commit: ecdbb200ba7f29fca9a0fd60478d16dce681afe7
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=ecdbb200ba7f29fca9a0fd60478d16dce681afe7

Author: Stefan Sayer <[email protected]>
Committer: Stefan Sayer <[email protected]>
Date:   Wed Oct 12 22:38:39 2011 +0200

b/f: cleaner shutdown of registration timer thread

---

 apps/db_reg_agent/DBRegAgent.cpp        |    1 +
 apps/db_reg_agent/RegistrationTimer.cpp |    4 +++-
 apps/db_reg_agent/RegistrationTimer.h   |    1 +
 3 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/apps/db_reg_agent/DBRegAgent.cpp b/apps/db_reg_agent/DBRegAgent.cpp
index 8d91710..aa87825 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 ff74031..dcd3e54 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 14e2b9a..27eb072 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

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to