diff options
author | Matthew Newhook <matthew@zeroc.com> | 2008-06-05 16:20:05 +0800 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2008-06-06 15:28:20 +0200 |
commit | 2942ca65d99dd9ecc4beb9b11dc5fb9a8ec5e305 (patch) | |
tree | a0b0006fb6d92ec94d7b2e4b1eb7c8d1ec158ad5 /cpp/src/Ice/FactoryTableDef.cpp | |
parent | http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=3239 - Under windows stati... (diff) | |
download | ice-2942ca65d99dd9ecc4beb9b11dc5fb9a8ec5e305.tar.bz2 ice-2942ca65d99dd9ecc4beb9b11dc5fb9a8ec5e305.tar.xz ice-2942ca65d99dd9ecc4beb9b11dc5fb9a8ec5e305.zip |
Get rid of the factory table wrapper.
Diffstat (limited to 'cpp/src/Ice/FactoryTableDef.cpp')
-rw-r--r-- | cpp/src/Ice/FactoryTableDef.cpp | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/cpp/src/Ice/FactoryTableDef.cpp b/cpp/src/Ice/FactoryTableDef.cpp index 06d84cd8128..a217e3a996b 100644 --- a/cpp/src/Ice/FactoryTableDef.cpp +++ b/cpp/src/Ice/FactoryTableDef.cpp @@ -14,16 +14,6 @@ # include <dlfcn.h> #endif -namespace IceInternal -{ - -FactoryTableWrapper factoryTableWrapper; // Single global instance of the wrapper object that - // initializes factoryTable. - -ICE_DECLSPEC_EXPORT FactoryTableDef* factoryTable; // Single global instance of the factory table for - // non-local exceptions and non-abstract classes -} - // // Add a factory to the exception factory table. // If the factory is present already, increment its reference count. @@ -167,49 +157,3 @@ IceInternal::FactoryTableDef::removeObjectFactory(const std::string& t) } } -// -// The code generated by slice2cpp contains a file static instance of FactoryTable. -// The constructor of FactoryTable calls initialize(), as does the constructor of -// FactoryTableWrapper. This ensures that the global factoryTable variable is initialized -// before it can be used, regardless of the order of initialization of global objects. -// -IceInternal::FactoryTableWrapper::FactoryTableWrapper() -{ - initialize(); -} - -IceInternal::FactoryTableWrapper::~FactoryTableWrapper() -{ - finalize(); -} - -// -// Initialize the single global instance of the factory table, counting -// the number of calls made. -// -void -IceInternal::FactoryTableWrapper::initialize() -{ - IceUtil::StaticMutex::Lock lock(_m); - if(_initCount == 0) - { - factoryTable = new FactoryTableDef; - } - ++_initCount; -} - -// -// Delete the table if its reference count drops to zero. -// -void -IceInternal::FactoryTableWrapper::finalize() -{ - IceUtil::StaticMutex::Lock lock(_m); - if(--_initCount == 0) - { - delete factoryTable; - } -} - -IceUtil::StaticMutex IceInternal::FactoryTableWrapper::_m = ICE_STATIC_MUTEX_INITIALIZER; -int IceInternal::FactoryTableWrapper::_initCount = 0; // Initialization count |