From ee07f3d07f07afdace189819528017e523836cbd Mon Sep 17 00:00:00 2001 From: rich_sposato Date: Tue, 6 Sep 2011 23:21:38 +0000 Subject: [PATCH] Added return type and return statements to fix bug 3399654. git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@1090 7ec92016-0320-0410-acc4-a06ded1c099a --- include/loki/Threads.h | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/include/loki/Threads.h b/include/loki/Threads.h index 13c88c8..5ce5330 100644 --- a/include/loki/Threads.h +++ b/include/loki/Threads.h @@ -127,11 +127,17 @@ return lval; \ } \ \ - static void AtomicAssign(volatile IntType& lval, const IntType val) \ - { InterlockedExchange(&const_cast(lval), val); } \ + static IntType AtomicAssign(volatile IntType& lval, const IntType val) \ + { \ + InterlockedExchange(&const_cast(lval), val); \ + return lval; \ + } \ \ - static void AtomicAssign(IntType& lval, volatile const IntType& val) \ - { InterlockedExchange(&lval, val); } \ + static IntType AtomicAssign(IntType& lval, volatile const IntType& val) \ + { \ + InterlockedExchange(&lval, val); \ + return lval; \ + } \ \ static IntType AtomicIncrement(volatile IntType& lval, const IntType compare, bool & matches ) \ { \ @@ -249,7 +255,7 @@ return lval; \ } \ \ - static void AtomicAssign(volatile IntType& lval, const IntType val) \ + static IntType AtomicAssign(volatile IntType& lval, const IntType val) \ { \ ::pthread_mutex_lock( &atomic_mutex_ ); \ lval = val; \ @@ -257,7 +263,7 @@ return lval; \ } \ \ - static void AtomicAssign(IntType& lval, volatile const IntType& val) \ + static IntType AtomicAssign(IntType& lval, volatile const IntType& val) \ { \ ::pthread_mutex_lock( &atomic_mutex_ ); \ lval = val; \ @@ -394,11 +400,17 @@ namespace Loki static IntType AtomicDecrement(volatile IntType& lval) { return --lval; } - static void AtomicAssign(volatile IntType & lval, const IntType val) - { lval = val; } + static IntType AtomicAssign(volatile IntType & lval, const IntType val) + { + lval = val; + return lval; + } - static void AtomicAssign(IntType & lval, volatile IntType & val) - { lval = val; } + static IntType AtomicAssign(IntType & lval, volatile IntType & val) + { + lval = val; + return lval; + } static IntType AtomicAdd(volatile IntType& lval, const IntType val, const IntType compare, bool & matches ) {