Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tao / PortableServer / Non_Servant_Upcall.h
blob3bf8925033f05dde07649b02cde896d25f57dda7
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Non_Servant_Upcall.h
7 * @author Irfan Pyarali
8 */
9 //=============================================================================
11 #ifndef TAO_NONSERVANT_UPCALL_H
12 #define TAO_NONSERVANT_UPCALL_H
14 #include /**/ "ace/pre.h"
16 #include "tao/PortableServer/portableserver_export.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 # pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include "tao/orbconf.h"
24 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
26 // Forward declaration
27 class TAO_Root_POA;
28 class TAO_Object_Adapter;
30 namespace TAO
32 namespace Portable_Server
34 /**
35 * @class Non_Servant_Upcall
37 * @brief This class helps us with a recursive thread lock without
38 * using a recursive thread lock. Non_Servant_Upcall has a
39 * magic constructor and destructor. We unlock the
40 * Object_Adapter lock for the duration of the non-servant
41 * (i.e., adapter activator and servant activator) upcalls;
42 * reacquiring once the upcalls complete. Even though we are
43 * releasing the lock, other threads will not be able to make
44 * progress since
45 * <Object_Adapter::non_servant_upcall_in_progress_> has been
46 * set.
48 class TAO_PortableServer_Export Non_Servant_Upcall
50 public:
51 /// Constructor.
52 Non_Servant_Upcall (::TAO_Root_POA &poa);
54 /// Destructor.
55 ~Non_Servant_Upcall ();
57 ::TAO_Root_POA &poa () const;
59 protected:
60 TAO_Object_Adapter &object_adapter_;
61 TAO_Root_POA &poa_;
62 Non_Servant_Upcall *previous_;
67 TAO_END_VERSIONED_NAMESPACE_DECL
69 #if defined (__ACE_INLINE__)
70 # include "tao/PortableServer/Non_Servant_Upcall.inl"
71 #endif /* __ACE_INLINE__ */
73 #include /**/ "ace/post.h"
75 #endif /* TAO_NONSERVANT_UPCALL_H */