You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2012/08/04 00:39:59 UTC
svn commit: r1369238 -
/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/concurrent/windows/Atomics.cpp
Author: tabish
Date: Fri Aug 3 22:39:58 2012
New Revision: 1369238
URL: http://svn.apache.org/viewvc?rev=1369238&view=rev
Log:
fix incrementAndGet on windows
Modified:
activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/concurrent/windows/Atomics.cpp
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/concurrent/windows/Atomics.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/concurrent/windows/Atomics.cpp?rev=1369238&r1=1369237&r2=1369238&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/concurrent/windows/Atomics.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/concurrent/windows/Atomics.cpp Fri Aug 3 22:39:58 2012
@@ -31,51 +31,51 @@ void Atomics::shutdown() {
////////////////////////////////////////////////////////////////////////////////
bool Atomics::compareAndSet32(volatile int* target, int expect, int update ) {
- return ::InterlockedCompareExchange((volatile LONG*)target, update, expect) == (unsigned int)expect;
+ return ::InterlockedCompareExchange((volatile LONG*)target, update, expect) == (unsigned int)expect;
}
////////////////////////////////////////////////////////////////////////////////
bool Atomics::compareAndSet(volatile void** target, void* expect, void* update) {
- return ::InterlockedCompareExchangePointer((volatile PVOID*)target, (void*)update, (void*)expect ) == (void*)expect;
+ return ::InterlockedCompareExchangePointer((volatile PVOID*)target, (void*)update, (void*)expect ) == (void*)expect;
}
////////////////////////////////////////////////////////////////////////////////
int Atomics::getAndSet(volatile int* target, int newValue) {
- return ::InterlockedExchange((volatile LONG*)target, newValue);
+ return ::InterlockedExchange((volatile LONG*)target, newValue);
}
////////////////////////////////////////////////////////////////////////////////
void* Atomics::getAndSet(volatile void** target, void* newValue) {
- return InterlockedExchangePointer((volatile PVOID*)target, newValue);
+ return InterlockedExchangePointer((volatile PVOID*)target, newValue);
}
////////////////////////////////////////////////////////////////////////////////
int Atomics::getAndIncrement(volatile int* target) {
- return ::InterlockedIncrement((volatile LONG*)target) - 1;
+ return ::InterlockedIncrement((volatile LONG*)target) - 1;
}
////////////////////////////////////////////////////////////////////////////////
int Atomics::getAndDecrement(volatile int* target) {
- return ::InterlockedExchangeAdd((volatile LONG*)target, 0xFFFFFFFF);
+ return ::InterlockedExchangeAdd((volatile LONG*)target, 0xFFFFFFFF);
}
////////////////////////////////////////////////////////////////////////////////
int Atomics::getAndAdd(volatile int* target, int delta) {
- return ::InterlockedExchangeAdd((volatile LONG*)target, delta);
+ return ::InterlockedExchangeAdd((volatile LONG*)target, delta);
}
////////////////////////////////////////////////////////////////////////////////
int Atomics::addAndGet(volatile int* target, int delta) {
- return ::InterlockedExchangeAdd((volatile LONG*)target, delta) + delta;
+ return ::InterlockedExchangeAdd((volatile LONG*)target, delta) + delta;
}
////////////////////////////////////////////////////////////////////////////////
int Atomics::incrementAndGet(volatile int* target) {
- return ::InterlockedIncrement((volatile LONG*)target) + 1;
+ return ::InterlockedIncrement((volatile LONG*)target);
}
////////////////////////////////////////////////////////////////////////////////
int Atomics::decrementAndGet(volatile int* target) {
- return ::InterlockedExchangeAdd((volatile LONG*)target, 0xFFFFFFFF) - 1;
+ return ::InterlockedExchangeAdd((volatile LONG*)target, 0xFFFFFFFF) - 1;
}