summaryrefslogtreecommitdiff
path: root/TAO/tao/CSD_ThreadPool/CSD_TP_Collocated_Synch_Request.inl
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tao/CSD_ThreadPool/CSD_TP_Collocated_Synch_Request.inl')
-rw-r--r--TAO/tao/CSD_ThreadPool/CSD_TP_Collocated_Synch_Request.inl59
1 files changed, 59 insertions, 0 deletions
diff --git a/TAO/tao/CSD_ThreadPool/CSD_TP_Collocated_Synch_Request.inl b/TAO/tao/CSD_ThreadPool/CSD_TP_Collocated_Synch_Request.inl
new file mode 100644
index 00000000000..c92dfe4719f
--- /dev/null
+++ b/TAO/tao/CSD_ThreadPool/CSD_TP_Collocated_Synch_Request.inl
@@ -0,0 +1,59 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#include "ace/Auto_Ptr.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO::CSD::TP_Collocated_Synch_Request::TP_Collocated_Synch_Request
+ (TAO_ServerRequest& server_request,
+ const PortableServer::ObjectId& object_id,
+ PortableServer::POA_ptr poa,
+ const char* operation,
+ PortableServer::Servant servant,
+ TP_Servant_State* servant_state)
+ : TP_Corba_Request(object_id,
+ poa,
+ operation,
+ servant,
+ servant_state,
+ server_request),
+ exception_(0)
+{
+}
+
+
+ACE_INLINE
+bool
+TAO::CSD::TP_Collocated_Synch_Request::wait(ACE_ENV_SINGLE_ARG_DECL)
+{
+ bool dispatched = this->synch_helper_.wait_while_pending();
+
+ if (dispatched)
+ {
+ // Check to see if the dispatching caused an exception to be raised.
+ if (this->exception_ != 0)
+ {
+ // An exception was raised during the actual dispatching to
+ // the servant. We need to raise the exception to our caller,
+ // which is the thread that made the collocated request in the
+ // first place.
+ CORBA::Exception* ex = this->exception_;
+ this->exception_ = 0;
+
+#if defined (TAO_HAS_EXCEPTIONS)
+ ACE_Auto_Basic_Ptr<CORBA::Exception> ex_holder(ex);
+ ex->_raise ();
+#else
+ ACE_TRY_ENV.exception (ex);
+#endif /* ACE_HAS_EXCEPTIONS */
+ }
+ }
+
+ return dispatched;
+
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL