diff options
author | Oscar Fuentes <ofv@wanadoo.es> | 2009-12-07 05:29:59 +0000 |
---|---|---|
committer | Oscar Fuentes <ofv@wanadoo.es> | 2009-12-07 05:29:59 +0000 |
commit | 4aafc85f5a94802c121050ec113973249e295577 (patch) | |
tree | 73c65c1ebedcf50a6e978cf77178e8bfd452457c /lib/System/Atomic.cpp | |
parent | 18552eb96f80811caa9f48141219ebeb2eadc5b3 (diff) | |
download | external_llvm-4aafc85f5a94802c121050ec113973249e295577.zip external_llvm-4aafc85f5a94802c121050ec113973249e295577.tar.gz external_llvm-4aafc85f5a94802c121050ec113973249e295577.tar.bz2 |
Fixes the Atomic implementation if compiled by MSVC compiler.
sys::cas_flag should be long on this platform, InterlockedAdd() is
defined only for the Itanium architecture (according to MSDN).
Patch by Michael Beck!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90748 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System/Atomic.cpp')
-rw-r--r-- | lib/System/Atomic.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/System/Atomic.cpp b/lib/System/Atomic.cpp index f9b55a1..7ba8b77 100644 --- a/lib/System/Atomic.cpp +++ b/lib/System/Atomic.cpp @@ -85,7 +85,7 @@ sys::cas_flag sys::AtomicAdd(volatile sys::cas_flag* ptr, sys::cas_flag val) { #elif defined(__GNUC__) return __sync_add_and_fetch(ptr, val); #elif defined(_MSC_VER) - return InterlockedAdd(ptr, val); + return InterlockedExchangeAdd(ptr, val) + val; #else # error No atomic add implementation for your platform! #endif |