summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2003-05-25 09:04:57 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2003-05-25 09:04:57 +0000
commitb199ac42379b05dd0a490b22399089c1317d5c9d (patch)
treef4671975d7705faed9ef8a27dd033c2affcaba70
parent4b861993f8214901dfc0c1a4e075ba34fa2c605b (diff)
downloadATCD-b199ac42379b05dd0a490b22399089c1317d5c9d.tar.gz
ChangeLogTag: Sun May 25 09:02:12 UTC 2003 Johnny Willemsen <jwillemsen@remedy.nl>
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_ConsumerControl.cpp27
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_SupplierControl.cpp29
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Reactive_ConsumerControl.cpp21
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Reactive_SupplierControl.cpp21
-rw-r--r--TAO/orbsvcs/orbsvcs/Makefile.RTEventLogAdmin2
5 files changed, 70 insertions, 30 deletions
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_ConsumerControl.cpp b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_ConsumerControl.cpp
index a1741daf162..404fac5d5ba 100644
--- a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_ConsumerControl.cpp
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_ConsumerControl.cpp
@@ -28,6 +28,12 @@ TAO_CEC_Reactive_ConsumerControl::
{
this->reactor_ =
this->orb_->orb_core ()->reactor ();
+
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+ // Initialise timer_id_ to an invalid timer id, so that in case we don't
+ // schedule a timer, we don't cancel a random timer at shutdown
+ timer_id_ = -1;
+#endif /* TAO_HAS_CORBA_MESSAGING */
}
TAO_CEC_Reactive_ConsumerControl::~TAO_CEC_Reactive_ConsumerControl (void)
@@ -95,13 +101,6 @@ int
TAO_CEC_Reactive_ConsumerControl::activate (void)
{
#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
- timer_id_ = this->reactor_->schedule_timer (&this->adapter_,
- 0,
- this->rate_,
- this->rate_);
- if (timer_id_ == -1)
- return -1;
-
ACE_TRY_NEW_ENV
{
// Get the PolicyCurrent object
@@ -127,6 +126,20 @@ TAO_CEC_Reactive_ConsumerControl::activate (void)
any
ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
+
+ // Only schedule the timer, when the rate is not zero
+ if (this->rate_ != ACE_Time_Value::zero)
+ {
+ // Schedule the timer after these policies has been set, because the
+ // handle_timeout uses these policies, if done in front, the channel
+ // can crash when the timeout expires before initiazation is ready.
+ timer_id_ = this->reactor_->schedule_timer (&this->adapter_,
+ 0,
+ this->rate_,
+ this->rate_);
+ if (timer_id_ == -1)
+ return -1;
+ }
}
ACE_CATCHANY
{
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_SupplierControl.cpp b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_SupplierControl.cpp
index f7387bfaf0f..8c7ca1f703a 100644
--- a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_SupplierControl.cpp
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_SupplierControl.cpp
@@ -29,6 +29,12 @@ TAO_CEC_Reactive_SupplierControl::
{
this->reactor_ =
this->orb_->orb_core ()->reactor ();
+
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+ // Initialise timer_id_ to an invalid timer id, so that in case we don't
+ // schedule a timer, we don't cancel a random timer at shutdown
+ timer_id_ = -1;
+#endif /* TAO_HAS_CORBA_MESSAGING */
}
TAO_CEC_Reactive_SupplierControl::~TAO_CEC_Reactive_SupplierControl (void)
@@ -96,13 +102,6 @@ int
TAO_CEC_Reactive_SupplierControl::activate (void)
{
#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
- timer_id_ = this->reactor_->schedule_timer (&this->adapter_,
- 0,
- this->rate_,
- this->rate_);
- if (timer_id_ == -1)
- return -1;
-
ACE_TRY_NEW_ENV
{
// Get the PolicyCurrent object
@@ -118,7 +117,7 @@ TAO_CEC_Reactive_SupplierControl::activate (void)
// Timeout for polling state (default = 10 msec)
TimeBase::TimeT timeout = timeout_.usec() * 10;
- CORBA::Any any;
+ CORBA::Any any;
any <<= timeout;
this->policy_list_.length (1);
@@ -128,6 +127,20 @@ TAO_CEC_Reactive_SupplierControl::activate (void)
any
ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
+
+ // Only schedule the timer, when the rate is not zero
+ if (this->rate_ != ACE_Time_Value::zero)
+ {
+ // Schedule the timer after these policies has been set, because the
+ // handle_timeout uses these policies, if done in front, the channel
+ // can crash when the timeout expires before initiazation is ready.
+ timer_id_ = this->reactor_->schedule_timer (&this->adapter_,
+ 0,
+ this->rate_,
+ this->rate_);
+ if (timer_id_ == -1)
+ return -1;
+ }
}
ACE_CATCHANY
{
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_ConsumerControl.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_ConsumerControl.cpp
index 84eab4dc3c3..bbc653396e9 100644
--- a/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_ConsumerControl.cpp
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_ConsumerControl.cpp
@@ -92,13 +92,6 @@ int
TAO_EC_Reactive_ConsumerControl::activate (void)
{
#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
- long id = this->reactor_->schedule_timer (&this->adapter_,
- 0,
- this->rate_,
- this->rate_);
- if (id == -1)
- return -1;
-
ACE_TRY_NEW_ENV
{
// Get the PolicyCurrent object
@@ -124,6 +117,20 @@ TAO_EC_Reactive_ConsumerControl::activate (void)
any
ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
+
+ // Only schedule the timer, when the rate is not zero
+ if (this->rate_ != ACE_Time_Value::zero)
+ {
+ // Schedule the timer after these policies has been set, because the
+ // handle_timeout uses these policies, if done in front, the channel
+ // can crash when the timeout expires before initiazation is ready.
+ long id = this->reactor_->schedule_timer (&this->adapter_,
+ 0,
+ this->rate_,
+ this->rate_);
+ if (id == -1)
+ return -1;
+ }
}
ACE_CATCHANY
{
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_SupplierControl.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_SupplierControl.cpp
index 30c83096e8c..0756fba3b3e 100644
--- a/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_SupplierControl.cpp
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_SupplierControl.cpp
@@ -92,13 +92,6 @@ int
TAO_EC_Reactive_SupplierControl::activate (void)
{
#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
- long id = this->reactor_->schedule_timer (&this->adapter_,
- 0,
- this->rate_,
- this->rate_);
- if (id == -1)
- return -1;
-
ACE_TRY_NEW_ENV
{
// Get the PolicyCurrent object
@@ -124,6 +117,20 @@ TAO_EC_Reactive_SupplierControl::activate (void)
any
ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
+
+ // Only schedule the timer, when the rate is not zero
+ if (this->rate_ != ACE_Time_Value::zero)
+ {
+ // Schedule the timer after these policies has been set, because the
+ // handle_timeout uses these policies, if done in front, the channel
+ // can crash when the timeout expires before initiazation is ready.
+ long id = this->reactor_->schedule_timer (&this->adapter_,
+ 0,
+ this->rate_,
+ this->rate_);
+ if (id == -1)
+ return -1;
+ }
}
ACE_CATCHANY
{
diff --git a/TAO/orbsvcs/orbsvcs/Makefile.RTEventLogAdmin b/TAO/orbsvcs/orbsvcs/Makefile.RTEventLogAdmin
index 24b383cd5b3..4cad48a8a92 100644
--- a/TAO/orbsvcs/orbsvcs/Makefile.RTEventLogAdmin
+++ b/TAO/orbsvcs/orbsvcs/Makefile.RTEventLogAdmin
@@ -14,7 +14,7 @@ SHLIB = $(LIBNAME).$(SOEXT)
VPATH=.:Log
-ACE_SHLIBS = -lTAO_DsLogAdmin -lTAO_CosEvent -lTAO_PortableServer -lTAO -lACE
+ACE_SHLIBS = -lTAO_RTEvent -lTAO_DsLogAdmin -lTAO_CosEvent -lTAO_CosNaming -lTAO_PortableServer -lTAO -lACE
#----------------------------------------------------------------------------
# Include macros and targets