Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tao / CSD_ThreadPool / CSD_TP_Collocated_Synch_Request.inl
blobcbfb4be02de8b48c04d42f1e26fa320b93b6ac6f
1 // -*- C++ -*-
2 #include <memory>
4 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
6 ACE_INLINE
7 TAO::CSD::TP_Collocated_Synch_Request::TP_Collocated_Synch_Request
8                              (TAO_ServerRequest&              server_request,
9                               const PortableServer::ObjectId& object_id,
10                               PortableServer::POA_ptr         poa,
11                               const char*                     operation,
12                               PortableServer::Servant         servant,
13                               TP_Servant_State*               servant_state)
14   : TP_Corba_Request(object_id,
15                      poa,
16                      operation,
17                      servant,
18                      servant_state,
19                      server_request),
20     exception_(0)
25 ACE_INLINE
26 bool
27 TAO::CSD::TP_Collocated_Synch_Request::wait()
29   bool dispatched = this->synch_helper_.wait_while_pending();
31   if (dispatched)
32     {
33       // Check to see if the dispatching caused an exception to be raised.
34       if (this->exception_ != 0)
35         {
36           // An exception was raised during the actual dispatching to
37           // the servant.  We need to raise the exception to our caller,
38           // which is the thread that made the collocated request in the
39           // first place.
40           CORBA::Exception* ex = this->exception_;
41           this->exception_ = 0;
43           std::unique_ptr<CORBA::Exception> ex_holder(ex);
44           ex->_raise ();
45         }
46     }
48   return dispatched;
52 TAO_END_VERSIONED_NAMESPACE_DECL