summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2009-06-04 09:13:09 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2009-06-04 09:13:09 +0000
commitd62bdd4e60a2d7435ba37a528dd3e5244a65559e (patch)
tree47735b31625a66412fe9415a63bff7d55d3067cc
parent9245f923b05c9551b01638fd18ad08b52b51a4e4 (diff)
downloadATCD-d62bdd4e60a2d7435ba37a528dd3e5244a65559e.tar.gz
Thu Jun 4 09:13:50 UTC 2009 Johnny Willemsen <jwillemsen@remedy.nl>
* orbsvcs/Notify_Service/Notify_Service.cpp: * orbsvcs/Notify_Service/Notify_Service.h: Set the ORB in the worker to nil and also cancel the timer when we don't need it anymore
-rw-r--r--TAO/ChangeLog7
-rw-r--r--TAO/orbsvcs/Notify_Service/Notify_Service.cpp31
-rw-r--r--TAO/orbsvcs/Notify_Service/Notify_Service.h1
3 files changed, 28 insertions, 11 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index b5bb12f0644..c64e7ebdbcf 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,10 @@
+Thu Jun 4 09:13:50 UTC 2009 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * orbsvcs/Notify_Service/Notify_Service.cpp:
+ * orbsvcs/Notify_Service/Notify_Service.h:
+ Set the ORB in the worker to nil and also cancel the timer
+ when we don't need it anymore
+
Thu Jun 4 07:21:46 UTC 2009 Vladimir Zykov <vz@prismtech.com>
* tests/Bug_3676_Regression/Bug_3676_Regression.mpc:
diff --git a/TAO/orbsvcs/Notify_Service/Notify_Service.cpp b/TAO/orbsvcs/Notify_Service/Notify_Service.cpp
index b230d706671..e99c70eac8a 100644
--- a/TAO/orbsvcs/Notify_Service/Notify_Service.cpp
+++ b/TAO/orbsvcs/Notify_Service/Notify_Service.cpp
@@ -344,6 +344,7 @@ TAO_Notify_Service_Driver::run (void)
if (this->nthreads_ > 0)
{
worker_.thr_mgr ()->wait ();
+ worker_.orb (CORBA::ORB::_nil ());
return 0;
}
else
@@ -592,7 +593,8 @@ TAO_Notify_Service_Driver::parse_args (int argc, ACE_TCHAR *argv[])
/*****************************************************************/
LoggingWorker::LoggingWorker(TAO_Notify_Service_Driver* ns)
: ns_ (ns),
- started_ (false)
+ started_ (false),
+ timer_id_ (-1)
{
}
@@ -620,15 +622,15 @@ LoggingWorker::start ()
else {
if (this->ns_->logging_interval_ > ACE_Time_Value::zero)
{
- ACE_Time_Value delay;
- if (this->ns_->orb_->orb_core()->reactor()->
- schedule_timer (logging_strategy, 0, delay,
- this->ns_->logging_interval_) == -1)
- {
- ACE_ERROR ((LM_ERROR,
- ACE_TEXT("(%P|%t) Failed to schedule ")
- ACE_TEXT("logging switch timer\n")));
- }
+ timer_id_ = this->ns_->orb_->orb_core()->reactor()->
+ schedule_timer (logging_strategy, 0, this->ns_->logging_interval_,
+ this->ns_->logging_interval_);
+ if (timer_id_ == -1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT("(%P|%t) Failed to schedule ")
+ ACE_TEXT("logging switch timer\n")));
+ }
}
}
}
@@ -644,7 +646,7 @@ LoggingWorker::svc (void)
}
started_ = true;
this->logging_reactor_.run_event_loop();
-
+
return 0;
}
@@ -656,6 +658,13 @@ LoggingWorker::end ()
this->logging_reactor_.end_event_loop();
this->thr_mgr ()->wait ();
}
+
+ if (timer_id_ != -1)
+ {
+ this->ns_->orb_->orb_core()->reactor()->
+ cancel_timer (timer_id_);
+ timer_id_ = -1;
+ }
}
Worker::Worker (void)
diff --git a/TAO/orbsvcs/Notify_Service/Notify_Service.h b/TAO/orbsvcs/Notify_Service/Notify_Service.h
index fdf77292570..156f718a5a2 100644
--- a/TAO/orbsvcs/Notify_Service/Notify_Service.h
+++ b/TAO/orbsvcs/Notify_Service/Notify_Service.h
@@ -45,6 +45,7 @@ class LoggingWorker : public ACE_Task_Base
ACE_Reactor logging_reactor_;
TAO_Notify_Service_Driver* ns_;
bool started_;
+ long timer_id_;
};
/**