summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-07-25 01:53:38 +0000
committerirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-07-25 01:53:38 +0000
commitd82d13f7c6d9f54cae8540099565724bc16124c8 (patch)
tree7b7b66b01cfc8442eddc818dddfa99dfd8aaa7bc
parentb6e9faffcf601a9181abaa598c01d219e9ef515b (diff)
downloadATCD-d82d13f7c6d9f54cae8540099565724bc16124c8.tar.gz
*** empty log message ***
-rw-r--r--TAO/tao/ORB_Core.cpp26
-rw-r--r--TAO/tao/ORB_Core.h3
-rw-r--r--TAO/tao/PortableServer/Object_Adapter.cpp14
-rw-r--r--TAO/tao/RTPortableServer/RT_POA_Initializer.cpp9
-rw-r--r--TAO/tao/TAO_Internal.cpp3
-rw-r--r--TAO/tao/Thread_Lane_Resources.cpp80
6 files changed, 95 insertions, 40 deletions
diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp
index 5acb8ddc297..8708041785a 100644
--- a/TAO/tao/ORB_Core.cpp
+++ b/TAO/tao/ORB_Core.cpp
@@ -1323,31 +1323,6 @@ TAO_ORB_Core::thread_lane_resources_manager (void)
ACE_Dynamic_Service<TAO_Thread_Lane_Resources_Manager>::instance
(TAO_ORB_Core::thread_lane_resources_manager_name_);
- // If there still isn't a reference, allocate the default.
- if (this->thread_lane_resources_manager_ == 0)
- {
- if (TAO_debug_level > 0)
- ACE_ERROR ((LM_WARNING,
- ACE_TEXT ("(%P|%t) WARNING - No Thread Lane Resources Manager found ")
- ACE_TEXT ("in Service Repository.\n")
- ACE_TEXT (" Using default instance with GLOBAL resource ")
- ACE_TEXT ("source specifier.\n")));
-
- // @@ RTCORBA Subsetting: The following comment probably should say
- // this if this doesn't work, a segmentation fault will be quickly
- // generated...
-
- // This will throw an exception if it fails on exception-throwing
- // platforms.
- TAO_Thread_Lane_Resources_Manager *thread_lane_resources_manager;
- ACE_NEW_RETURN (thread_lane_resources_manager,
- TAO_Default_Thread_Lane_Resources_Manager,
- 0);
-
- // Store a copy for later use.
- this->thread_lane_resources_manager_ = thread_lane_resources_manager;
- }
-
// Initialize the resources.
this->thread_lane_resources_manager_->initialize (*this);
@@ -3096,6 +3071,7 @@ TAO_ORB_Core_TSS_Resources::TAO_ORB_Core_TSS_Resources (void)
event_loop_thread_ (0),
client_leader_thread_ (0),
leader_follower_condition_variable_ (0),
+ lane_ (0),
reactor_registry_ (0),
reactor_registry_cookie_ (0),
ts_objects_ (),
diff --git a/TAO/tao/ORB_Core.h b/TAO/tao/ORB_Core.h
index cf409ee795f..1b705fef473 100644
--- a/TAO/tao/ORB_Core.h
+++ b/TAO/tao/ORB_Core.h
@@ -152,6 +152,9 @@ public:
/// Condition variable for the leader follower model.
TAO_SYNCH_CONDITION* leader_follower_condition_variable_;
+ /// Lane for this thread.
+ void *lane_;
+
/// The Reactor Holder that we should callback when destroying the
/// cookie.
TAO_Reactor_Registry *reactor_registry_;
diff --git a/TAO/tao/PortableServer/Object_Adapter.cpp b/TAO/tao/PortableServer/Object_Adapter.cpp
index 415886c435f..768c5279d01 100644
--- a/TAO/tao/PortableServer/Object_Adapter.cpp
+++ b/TAO/tao/PortableServer/Object_Adapter.cpp
@@ -578,18 +578,6 @@ TAO_Object_Adapter::open (CORBA::Environment &ACE_TRY_ENV)
PortableServer::POAManager_var safe_poa_manager = poa_manager;
-#if 0
- TAO_POA_Policy_Set root_poa_policies (this->default_poa_policies ());
-
- if (policies == 0)
- {
- // RootPOA policies defined in spec
- root_poa_policies.implicit_activation (
- PortableServer::IMPLICIT_ACTIVATION);
-
- policies = &root_poa_policies;
- }
-#else
TAO_POA_Policy_Set policies (this->default_poa_policies ());
#if (TAO_HAS_MINIMUM_POA == 0)
@@ -604,8 +592,6 @@ TAO_Object_Adapter::open (CORBA::Environment &ACE_TRY_ENV)
ACE_TRY_ENV);
#endif /* TAO_HAS_MINIMUM_POA == 0 */
-#endif /* 0 */
-
// Construct a new POA
TAO_POA::String root_poa_name (TAO_DEFAULT_ROOTPOA_NAME);
this->root_ = this->servant_dispatcher_->create_POA (root_poa_name,
diff --git a/TAO/tao/RTPortableServer/RT_POA_Initializer.cpp b/TAO/tao/RTPortableServer/RT_POA_Initializer.cpp
index d2b0c9bcfa2..4be11dea699 100644
--- a/TAO/tao/RTPortableServer/RT_POA_Initializer.cpp
+++ b/TAO/tao/RTPortableServer/RT_POA_Initializer.cpp
@@ -58,5 +58,12 @@ TAO_RT_POA_Initializer::init_rt_default_policies (TAO_POA_Policy_Set &policies,
policies.merge_policy (protocol.in (), ACE_TRY_ENV);
ACE_CHECK;
}
-}
+ CORBA::Policy_var thread_pool =
+ orb_core.get_cached_policy (TAO_CACHED_POLICY_THREADPOOL);
+ if (!CORBA::is_nil (thread_pool.in ()))
+ {
+ policies.merge_policy (thread_pool.in (), ACE_TRY_ENV);
+ ACE_CHECK;
+ }
+}
diff --git a/TAO/tao/TAO_Internal.cpp b/TAO/tao/TAO_Internal.cpp
index 8cb59507ef7..c82397ec8f8 100644
--- a/TAO/tao/TAO_Internal.cpp
+++ b/TAO/tao/TAO_Internal.cpp
@@ -23,6 +23,7 @@
#include "Default_Stub_Factory.h"
#include "Default_Endpoint_Selector_Factory.h"
#include "Default_Protocols_Hooks.h"
+#include "Thread_Lane_Resources.h"
ACE_RCSID (tao,
TAO_Internal,
@@ -218,6 +219,8 @@ TAO_Internal::open_services_i (int &argc,
insert (&ace_svc_desc_TAO_Default_Endpoint_Selector_Factory);
ACE_Service_Config::static_svcs ()->
insert (&ace_svc_desc_TAO_Default_Protocols_Hooks);
+ ACE_Service_Config::static_svcs ()->
+ insert (&ace_svc_desc_TAO_Default_Thread_Lane_Resources_Manager);
int result = 0;
diff --git a/TAO/tao/Thread_Lane_Resources.cpp b/TAO/tao/Thread_Lane_Resources.cpp
index ae881a0c973..4ba21fe3ea1 100644
--- a/TAO/tao/Thread_Lane_Resources.cpp
+++ b/TAO/tao/Thread_Lane_Resources.cpp
@@ -218,6 +218,86 @@ TAO_Default_Thread_Lane_Resources_Manager::lane_resources (void)
// ****************************************************************
+TAO_RT_Thread_Lane_Resources_Manager::TAO_RT_Thread_Lane_Resources_Manager (void)
+ : open_called_ (0),
+ default_lane_resources_ (0),
+ orb_core_ (0)
+{
+}
+
+TAO_RT_Thread_Lane_Resources_Manager::~TAO_RT_Thread_Lane_Resources_Manager (void)
+{
+ delete this->default_lane_resources_;
+}
+
+int
+TAO_RT_Thread_Lane_Resources_Manager::initialize (TAO_ORB_Core &orb_core)
+{
+ this->orb_core_ =
+ &orb_core;
+
+ ACE_NEW_RETURN (this->default_lane_resources_,
+ TAO_Thread_Lane_Resources (orb_core),
+ -1);
+
+ return 0;
+}
+
+int
+TAO_RT_Thread_Lane_Resources_Manager::open (CORBA_Environment &ACE_TRY_ENV)
+{
+ // Double check pattern
+ if (this->open_called_ == 1)
+ return 1;
+
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, tao_mon, this->open_lock_, -1);
+
+ if (this->open_called_ == 1)
+ return 1;
+
+ TAO_Acceptor_Registry &ar =
+ this->default_lane_resources_->acceptor_registry ();
+ // get a reference to the acceptor_registry!
+
+ int ret =
+ ar.open (this->orb_core_,
+ this->default_lane_resources_->leader_follower ().reactor (),
+ ACE_TRY_ENV);
+ ACE_CHECK_RETURN (-1);
+
+ if (ret == -1)
+ return -1;
+
+ this->open_called_ = 1;
+
+ return 0;
+}
+
+void
+TAO_RT_Thread_Lane_Resources_Manager::finalize (void)
+{
+ this->default_lane_resources_->finalize ();
+}
+
+TAO_Thread_Lane_Resources &
+TAO_RT_Thread_Lane_Resources_Manager::lane_resources (void)
+{
+ /// Get the ORB_Core's TSS resources.
+ TAO_ORB_Core_TSS_Resources &tss =
+ this->orb_core_->get_tss_resources ();
+
+ /// Get the lane for this thread.
+ TAO_Thread_Lane *lane =
+ (TAO_Thread_Lane *) tss.lane_;
+
+ if (lane)
+ return lane->resources ();
+ else
+ return *this->default_lane_resources_;
+}
+
+// ****************************************************************
+
ACE_STATIC_SVC_DEFINE (TAO_Default_Thread_Lane_Resources_Manager,
ACE_TEXT ("Default_Thread_Lane_Resources_Manager"),
ACE_SVC_OBJ_T,