activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r772926 - /activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/atomic/AtomicBoolean.cpp
Date Fri, 08 May 2009 10:31:10 GMT
Author: tabish
Date: Fri May  8 10:31:10 2009
New Revision: 772926

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

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

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/atomic/AtomicBoolean.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/atomic/AtomicBoolean.cpp?rev=772926&r1=772925&r2=772926&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/atomic/AtomicBoolean.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/concurrent/atomic/AtomicBoolean.cpp
Fri May  8 10:31:10 2009
@@ -44,12 +44,7 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 bool AtomicBoolean::getAndSet( bool newValue ) {
-    for(;;) {
-        bool current = get();
-        if( compareAndSet( current, newValue ) ) {
-            return current;
-        }
-    }
+    return apr_atomic_xchg32( &this->value, newValue ) > 0 ? true : false;
 }
 
 ////////////////////////////////////////////////////////////////////////////////



Mime
View raw message