1 #include "tao/PortableServer/POA_Guard.h"
2 #include "tao/PortableServer/Root_POA.h"
3 #include "tao/ORB_Constants.h"
5 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
9 namespace Portable_Server
11 POA_Guard::POA_Guard (::TAO_Root_POA
&poa
, bool check_for_destruction
)
12 : guard_ (poa
.lock ())
14 if (!this->guard_
.locked ())
17 CORBA::SystemException::_tao_minor_code (
22 // Check if a non-servant upcall is in progress. If a non-servant
23 // upcall is in progress, wait for it to complete. Unless of
24 // course, the thread making the non-servant upcall is this thread.
25 poa
.object_adapter ().wait_for_non_servant_upcalls_to_complete ();
27 if (check_for_destruction
&& poa
.cleanup_in_progress ())
30 CORBA::BAD_INV_ORDER (
31 CORBA::SystemException::_tao_minor_code (
32 TAO_POA_BEING_DESTROYED
,
40 TAO_END_VERSIONED_NAMESPACE_DECL