summaryrefslogtreecommitdiff
path: root/TAO/tao/PortableServer/Non_Servant_Upcall.h
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tao/PortableServer/Non_Servant_Upcall.h')
-rw-r--r--TAO/tao/PortableServer/Non_Servant_Upcall.h79
1 files changed, 79 insertions, 0 deletions
diff --git a/TAO/tao/PortableServer/Non_Servant_Upcall.h b/TAO/tao/PortableServer/Non_Servant_Upcall.h
new file mode 100644
index 00000000000..92b05194d9d
--- /dev/null
+++ b/TAO/tao/PortableServer/Non_Servant_Upcall.h
@@ -0,0 +1,79 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Non_Servant_Upcall.h
+ *
+ * $Id$
+ *
+ * @author Irfan Pyarali
+ */
+//=============================================================================
+
+#ifndef TAO_NONSERVANT_UPCALL_H
+#define TAO_NONSERVANT_UPCALL_H
+
+#include /**/ "ace/pre.h"
+
+#include "tao/PortableServer/portableserver_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/orbconf.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Forward declaration
+class TAO_Root_POA;
+class TAO_Object_Adapter;
+
+namespace TAO
+{
+ namespace Portable_Server
+ {
+ /**
+ * @class Non_Servant_Upcall
+ *
+ * @brief This class helps us with a recursive thread lock without
+ * using a recursive thread lock. Non_Servant_Upcall has a
+ * magic constructor and destructor. We unlock the
+ * Object_Adapter lock for the duration of the non-servant
+ * (i.e., adapter activator and servant activator) upcalls;
+ * reacquiring once the upcalls complete. Even though we are
+ * releasing the lock, other threads will not be able to make
+ * progress since
+ * <Object_Adapter::non_servant_upcall_in_progress_> has been
+ * set.
+ */
+ class TAO_PortableServer_Export Non_Servant_Upcall
+ {
+ public:
+
+ /// Constructor.
+ Non_Servant_Upcall (::TAO_Root_POA &poa);
+
+ /// Destructor.
+ ~Non_Servant_Upcall (void);
+
+ ::TAO_Root_POA &poa (void) const;
+
+ protected:
+
+ TAO_Object_Adapter &object_adapter_;
+ TAO_Root_POA &poa_;
+ Non_Servant_Upcall *previous_;
+ };
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+# include "tao/PortableServer/Non_Servant_Upcall.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_NONSERVANT_UPCALL_H */