activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r772766 - /activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/atomic/AtomicInteger.cpp
Date Thu, 07 May 2009 20:41:41 GMT
Author: tabish
Date: Thu May  7 20:41:40 2009
New Revision: 772766

URL: http://svn.apache.org/viewvc?rev=772766&view=rev
Log:
AMQCPP-242 Changes to try and make AtomicInteger actually perform its operations atomically.

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/atomic/AtomicInteger.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/atomic/AtomicInteger.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/atomic/AtomicInteger.cpp?rev=772766&r1=772765&r2=772766&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/atomic/AtomicInteger.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/atomic/AtomicInteger.cpp
Thu May  7 20:41:40 2009
@@ -51,7 +51,7 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 int AtomicInteger::getAndDecrement() {
-    return apr_atomic_dec32( &this->value ) + 1;
+    return apr_atomic_add32( &this->value, 0xFFFFFFFF );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -66,7 +66,7 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 int AtomicInteger::decrementAndGet() {
-    return apr_atomic_dec32( &this->value );
+    return apr_atomic_add32( &this->value, 0xFFFFFFFF ) - 1;
 }
 
 ////////////////////////////////////////////////////////////////////////////////



Mime
View raw message