summaryrefslogtreecommitdiff
path: root/TAO/tao/IIOP_Connection_Handler.cpp
diff options
context:
space:
mode:
authorbala <bala@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-07-17 03:02:31 +0000
committerbala <bala@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-07-17 03:02:31 +0000
commitca35328f853dda1db3d36b85a8d5c0b1e022682d (patch)
tree4042b01b28c70390894739c1dea67cce548f0656 /TAO/tao/IIOP_Connection_Handler.cpp
parentb4aa2c76f2b4e50093b8ec3f4fbdeab86289a684 (diff)
downloadATCD-ca35328f853dda1db3d36b85a8d5c0b1e022682d.tar.gz
ChangeLogTag:Mon Jul 16 22:03:13 2001 Balachandran Natarajan <bala@cs.wustl.edu>
Diffstat (limited to 'TAO/tao/IIOP_Connection_Handler.cpp')
-rw-r--r--TAO/tao/IIOP_Connection_Handler.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/TAO/tao/IIOP_Connection_Handler.cpp b/TAO/tao/IIOP_Connection_Handler.cpp
index f897a5e0e11..c2c836de2dd 100644
--- a/TAO/tao/IIOP_Connection_Handler.cpp
+++ b/TAO/tao/IIOP_Connection_Handler.cpp
@@ -336,6 +336,28 @@ TAO_IIOP_Connection_Handler::handle_input (ACE_HANDLE)
if (--this->pending_upcalls_ <= 0)
retval = -1;
+ if (retval == -1)
+ {
+ // This is really a odd case. We could have a race condition if
+ // we dont do this. Looks like this what happens
+ // - imagine we have more than 1 server threads
+ // - The server has got more than one connection from the
+ // clients
+ // - The clients make requests and they start dissappearing.
+ // - The connections start getting closed
+ // - at that point one of the server threads is woken up to
+ // and handle_input () is called.
+ // - the handle_input sees no data and so is about return a -1.
+ // - if the handle is resumed, it looks like the oen more thread
+ // gets access to the handle and the handle_input is called by
+ // another thread.
+ // - at that point of time if the thread returning -1 to the
+ // reactor starts closing down the handler, bad things start
+ // happening.
+ // Looks subtle though. After adding this I dont see anything
+ // bad happenin and so let us stick with it...
+ resume_handle.set_flag (TAO_Resume_Handle::TAO_HANDLE_LEAVE_SUSPENDED);
+ }
return retval;
}