activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r991575 - /activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/src/main/activemq/util/IdGenerator.cpp
Date Wed, 01 Sep 2010 15:47:13 GMT
Author: tabish
Date: Wed Sep  1 15:47:12 2010
New Revision: 991575

URL: http://svn.apache.org/viewvc?rev=991575&view=rev
Log:
workaround fix for the 3.2.x branch for: https://issues.apache.org/activemq/browse/AMQCPP-314

Modified:
    activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/src/main/activemq/util/IdGenerator.cpp

Modified: activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/src/main/activemq/util/IdGenerator.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/src/main/activemq/util/IdGenerator.cpp?rev=991575&r1=991574&r2=991575&view=diff
==============================================================================
--- activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/src/main/activemq/util/IdGenerator.cpp
(original)
+++ activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/src/main/activemq/util/IdGenerator.cpp
Wed Sep  1 15:47:12 2010
@@ -22,6 +22,7 @@
 #include <decaf/lang/Thread.h>
 #include <decaf/net/InetAddress.h>
 #include <decaf/net/ServerSocket.h>
+#include <decaf/internal/net/Network.h>
 
 #include <apr_strings.h>
 
@@ -32,6 +33,7 @@ using namespace decaf::lang;
 using namespace decaf::net;
 using namespace decaf::util;
 using namespace decaf::util::concurrent;
+using namespace decaf::internal::net;
 
 ////////////////////////////////////////////////////////////////////////////////
 IdGenerator::StaticData::StaticData() : UNIQUE_STUB(), instanceCount(0), hostname() {
@@ -144,6 +146,11 @@ int IdGenerator::compare( const std::str
 
 ////////////////////////////////////////////////////////////////////////////////
 IdGenerator::StaticData& IdGenerator::getClassStaticData() {
-    static IdGenerator::StaticData statics;
-    return statics;
+
+    Network* netRuntime = Network::getNetworkRuntime();
+
+    synchronized( netRuntime->getRuntimeLock() ) {
+        static IdGenerator::StaticData statics;
+        return statics;
+    }
 }



Mime
View raw message