activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r888532 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging: LogManager.cpp LogManager.h
Date Tue, 08 Dec 2009 19:27:05 GMT
Author: tabish
Date: Tue Dec  8 19:27:05 2009
New Revision: 888532

URL: http://svn.apache.org/viewvc?rev=888532&view=rev
Log:
https://issues.apache.org/activemq/browse/AMQCPP-253

Remove static mutex instance, this was allow APR methods to get executed before apr_initialize
was called and since HP doesn't have any atomic builtins in APR the Hastable code in APR needs
to be initialized before a mutex can get created.

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/LogManager.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/LogManager.h

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/LogManager.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/LogManager.cpp?rev=888532&r1=888531&r2=888532&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/LogManager.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/LogManager.cpp Tue
Dec  8 19:27:05 2009
@@ -28,11 +28,6 @@
 using namespace decaf::util::logging;
 
 ////////////////////////////////////////////////////////////////////////////////
-concurrent::Mutex LogManager::mutex;
-LogManager* LogManager::instance = NULL;
-unsigned int LogManager::refCount = 0;
-
-////////////////////////////////////////////////////////////////////////////////
 LogManager::~LogManager()
 {
     // TODO - Delete all the loggers.
@@ -76,46 +71,14 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 LogManager* LogManager::getInstance() {
-
-    synchronized( &mutex ) {
-        if( instance == NULL ) {
-            instance = new LogManager();
-        }
-
-        refCount++;
-
-        return instance;
-    }
-
     return NULL;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void LogManager::returnInstance() {
-
-    synchronized( &mutex ) {
-        if( refCount == 0 ) {
-            return ;
-        }
-
-        refCount--;
-
-        if( refCount == 0 ) {
-            delete instance;
-            instance = NULL;
-        }
-    }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void LogManager::destroy()
 {
-    if( instance != NULL ) {
-
-        synchronized( &mutex ) {
-            delete instance;
-            instance = NULL;
-            refCount = 0;
-        }
-    }
 }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/LogManager.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/LogManager.h?rev=888532&r1=888531&r2=888532&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/LogManager.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/LogManager.h Tue
Dec  8 19:27:05 2009
@@ -234,17 +234,6 @@
          */
         void operator=( const LogManager& manager );
 
-    private:
-
-        // Static mutex to protect the singleton methods
-        static concurrent::Mutex mutex;
-
-        // Static pointer to the one and only instance.
-        static LogManager* instance;
-
-        // Static counter for number of outstanding references
-        static unsigned int refCount;
-
     };
 
 }}}



Mime
View raw message