summaryrefslogtreecommitdiff
path: root/TAO/tao/Connection_Handler.cpp
diff options
context:
space:
mode:
authorbala <bala@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2002-11-20 21:27:31 +0000
committerbala <bala@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2002-11-20 21:27:31 +0000
commitbdb7b21ed62bfbd142beeacb320a11659e35d39a (patch)
tree3f8cb3bc70f6cea8c1c92c52f3db917175623dc7 /TAO/tao/Connection_Handler.cpp
parent6f5452dd2cbc1b48c485fc0904f683487e21137f (diff)
downloadATCD-bdb7b21ed62bfbd142beeacb320a11659e35d39a.tar.gz
ChangeLogTag:Wed Nov 20 15:23:13 2002 Balachandran Natarajan <bala@isis-server.isis.vanderbilt.edu>
Diffstat (limited to 'TAO/tao/Connection_Handler.cpp')
-rw-r--r--TAO/tao/Connection_Handler.cpp45
1 files changed, 29 insertions, 16 deletions
diff --git a/TAO/tao/Connection_Handler.cpp b/TAO/tao/Connection_Handler.cpp
index 7a45a62ed6f..8247448db26 100644
--- a/TAO/tao/Connection_Handler.cpp
+++ b/TAO/tao/Connection_Handler.cpp
@@ -405,19 +405,32 @@ TAO_Connection_Handler::close_connection_eh (ACE_Event_Handler * eh)
// The Reactor must not be null, otherwise something else is
// horribly broken.
- ACE_Reactor * reactor = this->transport()->orb_core()->reactor ();
- ACE_ASSERT(reactor != 0);
+ ACE_Reactor * eh_reactor = eh->reactor ();
+ ACE_ASSERT(eh_reactor != 0);
- {
- ACE_Reactor * orb_core_reactor = this->orb_core_->reactor ();
- ACE_ASSERT(reactor == orb_core_reactor);
-
- ACE_Reactor * eh_reactor = eh->reactor ();
- ACE_ASSERT(eh_reactor == 0 || eh_reactor == reactor);
-
- ACE_UNUSED_ARG (orb_core_reactor);
- ACE_UNUSED_ARG (eh_reactor);
- }
+ // These checks are valid as long as the ORB_Core is not
+ // shutdown. It is good to have these checks and they are valid
+ // for most of the cases. Please see below for exceptions
+ if (this->orb_core_->has_shutdown () == 0)
+ {
+ // The exception when these are not valid is for RTCORBA. With
+ // RTCORBA on, you can threads in different lanes creating
+ // handlers and registering them with reactor in those
+ // respective lanes. These threads could then even go away
+ // leaving the task of reclaiming these resources to the main
+ // thread. For the main thread that takes the responsibility
+ // of finalizing () the lanes and the pools, the calls and
+ // comparison make no sense.
+ ACE_Reactor * orb_core_reactor = this->orb_core_->reactor ();
+ ACE_ASSERT (eh_reactor == orb_core_reactor);
+
+ ACE_Reactor * reactor =
+ this->transport()->orb_core()->reactor ();
+ ACE_ASSERT (reactor == 0 || eh_reactor == reactor);
+
+ ACE_UNUSED_ARG (orb_core_reactor);
+ ACE_UNUSED_ARG (reactor);
+ }
if (TAO_debug_level)
{
@@ -427,9 +440,9 @@ TAO_Connection_Handler::close_connection_eh (ACE_Event_Handler * eh)
handle));
}
int r =
- reactor->remove_handler (handle,
- (ACE_Event_Handler::ALL_EVENTS_MASK
- | ACE_Event_Handler::DONT_CALL));
+ eh_reactor->remove_handler (handle,
+ (ACE_Event_Handler::ALL_EVENTS_MASK
+ | ACE_Event_Handler::DONT_CALL));
if(r == -1 && TAO_debug_level)
{
ACE_ERROR ((LM_ERROR,
@@ -447,7 +460,7 @@ TAO_Connection_Handler::close_connection_eh (ACE_Event_Handler * eh)
"close_connection, cancel all timers and refcount [%d]\n",
handle, reference_count_));
}
- r = reactor->cancel_timer (eh);
+ r = eh_reactor->cancel_timer (eh);
if (r == -1 && TAO_debug_level)
{
ACE_ERROR ((LM_ERROR,