summaryrefslogtreecommitdiff
path: root/TAO/tao
diff options
context:
space:
mode:
authorvzykov <vzykov@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-11-16 16:04:12 +0000
committervzykov <vzykov@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-11-16 16:04:12 +0000
commit7791e48a722ccd5deab3f1a0f05b13f7404a0758 (patch)
tree20a76676ad4db8ee1524e09fb14a88ca0929f1e3 /TAO/tao
parentc0a7107cfbaabc5663df730f0f7c355db1e48f2a (diff)
downloadATCD-7791e48a722ccd5deab3f1a0f05b13f7404a0758.tar.gz
Mon Nov 16 15:52:21 UTC 2009 Vladimir Zykov <vladimir.zykov@prismtech.com>
* bin/tao_orb_tests.lst: Bug 3755 marked as fixed. * tao/PI_Server/PI_Server_Loader.cpp: * tao/PI_Server/PI_Server_Loader.h: * tao/Messaging/Messaging_Loader.h: * tao/Messaging/Messaging_Loader.cpp: * tao/BiDir_GIOP/BiDirGIOP.cpp: * tao/BiDir_GIOP/BiDirGIOP.h: * tao/RTScheduling/RTScheduler_Loader.cpp: * tao/RTScheduling/RTScheduler_Loader.h: * tao/ZIOP/ZIOP.cpp: * tao/ZIOP/ZIOP.h: * tao/CSD_Framework/CSD_Framework_Loader.cpp: * tao/CSD_Framework/CSD_Framework_Loader.h: * tao/RTCORBA/RT_ORB_Loader.h: * tao/RTCORBA/RT_ORB_Loader.cpp: Fixed bug 3755. Now library initialization guard is moved to a loader which does the initialization. Since the loader is unique per gestalt then the initialization is executed once per gestalt and not once per process.
Diffstat (limited to 'TAO/tao')
-rw-r--r--TAO/tao/BiDir_GIOP/BiDirGIOP.cpp8
-rw-r--r--TAO/tao/BiDir_GIOP/BiDirGIOP.h2
-rw-r--r--TAO/tao/CSD_Framework/CSD_Framework_Loader.cpp7
-rw-r--r--TAO/tao/CSD_Framework/CSD_Framework_Loader.h4
-rw-r--r--TAO/tao/Messaging/Messaging_Loader.cpp8
-rw-r--r--TAO/tao/Messaging/Messaging_Loader.h4
-rw-r--r--TAO/tao/PI_Server/PI_Server_Loader.cpp7
-rw-r--r--TAO/tao/PI_Server/PI_Server_Loader.h4
-rw-r--r--TAO/tao/RTCORBA/RT_ORB_Loader.cpp11
-rw-r--r--TAO/tao/RTCORBA/RT_ORB_Loader.h7
-rw-r--r--TAO/tao/RTScheduling/RTScheduler_Loader.cpp11
-rw-r--r--TAO/tao/RTScheduling/RTScheduler_Loader.h7
-rw-r--r--TAO/tao/ZIOP/ZIOP.cpp8
-rw-r--r--TAO/tao/ZIOP/ZIOP.h5
14 files changed, 59 insertions, 34 deletions
diff --git a/TAO/tao/BiDir_GIOP/BiDirGIOP.cpp b/TAO/tao/BiDir_GIOP/BiDirGIOP.cpp
index 679c2e4bf69..ec73e7ce99c 100644
--- a/TAO/tao/BiDir_GIOP/BiDirGIOP.cpp
+++ b/TAO/tao/BiDir_GIOP/BiDirGIOP.cpp
@@ -12,10 +12,8 @@ ACE_RCSID (BiDir_GIOP,
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
-// Set the flag to zero to start with
-bool TAO_BiDirGIOP_Loader::is_activated_ = false;
-
TAO_BiDirGIOP_Loader::TAO_BiDirGIOP_Loader (void)
+ : initialized_ (false)
{
}
@@ -26,7 +24,7 @@ TAO_BiDirGIOP_Loader::~TAO_BiDirGIOP_Loader (void)
int
TAO_BiDirGIOP_Loader::init (int, ACE_TCHAR* [])
{
- if (TAO_BiDirGIOP_Loader::is_activated_ == false && TAO_DEF_GIOP_MINOR >= 2)
+ if (!this->initialized_ && TAO_DEF_GIOP_MINOR >= 2)
{
PortableInterceptor::ORBInitializer_ptr tmp_orb_initializer =
PortableInterceptor::ORBInitializer::_nil ();
@@ -48,7 +46,7 @@ TAO_BiDirGIOP_Loader::init (int, ACE_TCHAR* [])
PortableInterceptor::register_orb_initializer (
bidir_orb_initializer.in ());
- TAO_BiDirGIOP_Loader::is_activated_ = true;
+ this->initialized_ = true;
}
catch (const ::CORBA::Exception& ex)
{
diff --git a/TAO/tao/BiDir_GIOP/BiDirGIOP.h b/TAO/tao/BiDir_GIOP/BiDirGIOP.h
index b3b9a5c8359..cc3c3c0eb3b 100644
--- a/TAO/tao/BiDir_GIOP/BiDirGIOP.h
+++ b/TAO/tao/BiDir_GIOP/BiDirGIOP.h
@@ -61,7 +61,7 @@ private:
/// Flag to indicate whether the BiDirGIOP library has been
/// activated.
- static bool is_activated_;
+ bool initialized_;
};
static bool
diff --git a/TAO/tao/CSD_Framework/CSD_Framework_Loader.cpp b/TAO/tao/CSD_Framework/CSD_Framework_Loader.cpp
index 97771f3b9cb..4d2f47e09ec 100644
--- a/TAO/tao/CSD_Framework/CSD_Framework_Loader.cpp
+++ b/TAO/tao/CSD_Framework/CSD_Framework_Loader.cpp
@@ -16,6 +16,7 @@ ACE_RCSID (CSD_Framework,
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
TAO_CSD_Framework_Loader::TAO_CSD_Framework_Loader (void)
+ : initialized_ (false)
{
}
@@ -43,13 +44,11 @@ TAO_CSD_Framework_Loader::init (int, ACE_TCHAR* [])
{
ACE_TRACE ("TAO_CSD_Framework_Loader::init");
- static bool initialized = false;
-
// Only allow initialization once.
- if (initialized)
+ if (this->initialized_)
return 0;
- initialized = true;
+ this->initialized_ = true;
// Register the ORB initializer.
try
diff --git a/TAO/tao/CSD_Framework/CSD_Framework_Loader.h b/TAO/tao/CSD_Framework/CSD_Framework_Loader.h
index c648910a5e6..8d6854590f9 100644
--- a/TAO/tao/CSD_Framework/CSD_Framework_Loader.h
+++ b/TAO/tao/CSD_Framework/CSD_Framework_Loader.h
@@ -50,6 +50,10 @@ class TAO_CSD_FW_Export TAO_CSD_Framework_Loader : public ACE_Service_Object
/// Initialize the PI_Server loader hooks.
virtual int init (int argc, ACE_TCHAR* []);
+
+private:
+ /// Set to true after init is called.
+ bool initialized_;
};
diff --git a/TAO/tao/Messaging/Messaging_Loader.cpp b/TAO/tao/Messaging/Messaging_Loader.cpp
index eaa84728fc2..f31e5b78e03 100644
--- a/TAO/tao/Messaging/Messaging_Loader.cpp
+++ b/TAO/tao/Messaging/Messaging_Loader.cpp
@@ -15,6 +15,7 @@ ACE_RCSID (Messaging, Messaging_Loader, "$Id$")
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
TAO_Messaging_Loader::TAO_Messaging_Loader (void)
+ : initialized_ (false)
{
}
@@ -28,11 +29,10 @@ TAO_Messaging_Loader::init (int,
{
ACE_TRACE ("TAO_Messaging_Loader::init");
- static bool called_once = false;
-
- if (called_once == true)
+ if (this->initialized_)
return 0;
- called_once = true;
+
+ this->initialized_ = true;
PortableInterceptor::ORBInitializer_ptr temp_orb_initializer =
PortableInterceptor::ORBInitializer::_nil ();
diff --git a/TAO/tao/Messaging/Messaging_Loader.h b/TAO/tao/Messaging/Messaging_Loader.h
index ca63954f8bd..049e3e26d41 100644
--- a/TAO/tao/Messaging/Messaging_Loader.h
+++ b/TAO/tao/Messaging/Messaging_Loader.h
@@ -38,6 +38,10 @@ public:
/// Initialize the Messaging loader hooks.
virtual int init (int argc, ACE_TCHAR* []);
+
+private:
+ /// Set to true after init is called.
+ bool initialized_;
};
diff --git a/TAO/tao/PI_Server/PI_Server_Loader.cpp b/TAO/tao/PI_Server/PI_Server_Loader.cpp
index d953483b5eb..fbbc70400ab 100644
--- a/TAO/tao/PI_Server/PI_Server_Loader.cpp
+++ b/TAO/tao/PI_Server/PI_Server_Loader.cpp
@@ -15,6 +15,7 @@ ACE_RCSID (PI_Server,
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
TAO_PI_Server_Loader::TAO_PI_Server_Loader (void)
+ : initialized_ (false)
{
}
@@ -27,13 +28,11 @@ TAO_PI_Server_Loader::init (int, ACE_TCHAR* [])
{
ACE_TRACE ("TAO_PI_Server_Loader::init");
- static bool initialized = false;
-
// Only allow initialization once.
- if (initialized)
+ if (this->initialized_)
return 0;
- initialized = true;
+ this->initialized_ = true;
// Register the ORB initializer.
try
diff --git a/TAO/tao/PI_Server/PI_Server_Loader.h b/TAO/tao/PI_Server/PI_Server_Loader.h
index 81ffeb05250..58b691f7647 100644
--- a/TAO/tao/PI_Server/PI_Server_Loader.h
+++ b/TAO/tao/PI_Server/PI_Server_Loader.h
@@ -36,6 +36,10 @@ public:
/// Initialize the PI_Server loader hooks.
virtual int init (int argc, ACE_TCHAR* []);
+
+private:
+ /// Set to true after init is called.
+ bool initialized_;
};
diff --git a/TAO/tao/RTCORBA/RT_ORB_Loader.cpp b/TAO/tao/RTCORBA/RT_ORB_Loader.cpp
index 1d82a606d5a..81059d8c6b4 100644
--- a/TAO/tao/RTCORBA/RT_ORB_Loader.cpp
+++ b/TAO/tao/RTCORBA/RT_ORB_Loader.cpp
@@ -17,6 +17,11 @@ ACE_RCSID (RTCORBA,
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+TAO_RT_ORB_Loader::TAO_RT_ORB_Loader (void)
+ : initialized_ (false)
+{
+}
+
TAO_RT_ORB_Loader::~TAO_RT_ORB_Loader (void)
{
}
@@ -26,13 +31,11 @@ TAO_RT_ORB_Loader::init (int argc, ACE_TCHAR* argv[])
{
ACE_TRACE ("TAO_RT_ORB_Loader::init");
- static bool initialized = false;
-
// Only allow initialization once.
- if (initialized)
+ if (this->initialized_)
return 0;
- initialized = true;
+ this->initialized_ = true;
// Set defaults.
int priority_mapping_type =
diff --git a/TAO/tao/RTCORBA/RT_ORB_Loader.h b/TAO/tao/RTCORBA/RT_ORB_Loader.h
index 2c0f246d44c..caf14caebee 100644
--- a/TAO/tao/RTCORBA/RT_ORB_Loader.h
+++ b/TAO/tao/RTCORBA/RT_ORB_Loader.h
@@ -37,11 +37,18 @@ class TAO_RTCORBA_Export TAO_RT_ORB_Loader : public ACE_Service_Object
{
public:
+ /// Constructor.
+ TAO_RT_ORB_Loader (void);
+
/// Destructor.
virtual ~TAO_RT_ORB_Loader (void);
/// Initialize the RT ORB loader hooks.
virtual int init (int argc, ACE_TCHAR* []);
+
+private:
+ /// Set to true after init is called.
+ bool initialized_;
};
diff --git a/TAO/tao/RTScheduling/RTScheduler_Loader.cpp b/TAO/tao/RTScheduling/RTScheduler_Loader.cpp
index 1cebbe4d38e..f34c4b154d1 100644
--- a/TAO/tao/RTScheduling/RTScheduler_Loader.cpp
+++ b/TAO/tao/RTScheduling/RTScheduler_Loader.cpp
@@ -13,6 +13,11 @@ ACE_RCSID (TAO, RTScheduler_Loader, "$Id$")
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+TAO_RTScheduler_Loader::TAO_RTScheduler_Loader (void)
+ : initialized_ (false)
+{
+}
+
TAO_RTScheduler_Loader::~TAO_RTScheduler_Loader (void)
{
}
@@ -26,13 +31,11 @@ TAO_RTScheduler_Loader::init (int, ACE_TCHAR* [])
ACE_DEBUG ((LM_DEBUG,
"In RTScheduler_Loader::init\n"));
- static bool initialized = false;
-
// Only allow initialization once.
- if (initialized)
+ if (this->initialized_)
return 0;
- initialized = true;
+ this->initialized_ = true;
// Register the ORB initializer.
try
diff --git a/TAO/tao/RTScheduling/RTScheduler_Loader.h b/TAO/tao/RTScheduling/RTScheduler_Loader.h
index cb0f3e4d2d8..78b9d9bc7ae 100644
--- a/TAO/tao/RTScheduling/RTScheduler_Loader.h
+++ b/TAO/tao/RTScheduling/RTScheduler_Loader.h
@@ -33,11 +33,18 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL
class TAO_RTScheduler_Export TAO_RTScheduler_Loader : public ACE_Service_Object
{
public:
+ /// Constructor.
+ TAO_RTScheduler_Loader (void);
+
/// Destructor.
virtual ~TAO_RTScheduler_Loader (void);
/// Initialize the RTScheduler loader hooks.
virtual int init (int argc, ACE_TCHAR* []);
+
+private:
+ /// Set to true after init is called.
+ bool initialized_;
};
TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/tao/ZIOP/ZIOP.cpp b/TAO/tao/ZIOP/ZIOP.cpp
index 1f7df58d073..4db6e4dc954 100644
--- a/TAO/tao/ZIOP/ZIOP.cpp
+++ b/TAO/tao/ZIOP/ZIOP.cpp
@@ -14,10 +14,8 @@ ACE_RCSID (ZIOP,
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
-// Set the flag to zero to start with
-bool TAO_ZIOP_Loader::is_activated_ = false;
-
TAO_ZIOP_Loader::TAO_ZIOP_Loader (void)
+ : initialized_ (false)
{
}
@@ -29,7 +27,7 @@ int
TAO_ZIOP_Loader::init (int, ACE_TCHAR* [])
{
#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
- if (TAO_ZIOP_Loader::is_activated_ == false && TAO_DEF_GIOP_MINOR >= 2)
+ if (!this->initialized_ && TAO_DEF_GIOP_MINOR >= 2)
{
PortableInterceptor::ORBInitializer_ptr tmp_orb_initializer =
PortableInterceptor::ORBInitializer::_nil ();
@@ -51,7 +49,7 @@ TAO_ZIOP_Loader::init (int, ACE_TCHAR* [])
PortableInterceptor::register_orb_initializer (
ziop_orb_initializer.in ());
- TAO_ZIOP_Loader::is_activated_ = true;
+ this->initialized_ = true;
}
catch (const ::CORBA::Exception& ex)
{
diff --git a/TAO/tao/ZIOP/ZIOP.h b/TAO/tao/ZIOP/ZIOP.h
index fa458ff7064..63de0911460 100644
--- a/TAO/tao/ZIOP/ZIOP.h
+++ b/TAO/tao/ZIOP/ZIOP.h
@@ -66,9 +66,8 @@ public:
private:
- /// Flag to indicate whether the ZIOP library has been
- /// activated.
- static bool is_activated_;
+ /// Set to true after init is called.
+ bool initialized_;
/// dump a ZIOP datablock after (de)compression
void dump_msg (const char *type, const u_char *ptr,