subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1327458 - /subversion/trunk/subversion/libsvn_subr/svn_named_atomic.c
Date Wed, 18 Apr 2012 11:52:11 GMT
Author: stefan2
Date: Wed Apr 18 11:52:11 2012
New Revision: 1327458

URL: http://svn.apache.org/viewvc?rev=1327458&view=rev
Log:
Under Windows, use an Interlocked function for Add that is not only 
available on Itanium.

* subversion/libsvn_subr/svn_named_atomic.c
  (synched_add): use InterlockedExchangeAdd64 instead of InterlockedAdd64

Found by: rhuijben

Modified:
    subversion/trunk/subversion/libsvn_subr/svn_named_atomic.c

Modified: subversion/trunk/subversion/libsvn_subr/svn_named_atomic.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/svn_named_atomic.c?rev=1327458&r1=1327457&r2=1327458&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/svn_named_atomic.c (original)
+++ subversion/trunk/subversion/libsvn_subr/svn_named_atomic.c Wed Apr 18 11:52:11 2012
@@ -98,13 +98,13 @@
  * as well as any type of data access.  This is quite expensive and we
  * can do much better on most platforms.
  */
-#if defined(WIN32) && ((_WIN32_WINNT >= 0x0502) || defined(InterlockedAdd64))
+#if defined(WIN32) && ((_WIN32_WINNT >= 0x0502) || defined(InterlockedExchangeAdd64))
 
 /* Interlocked API / intrinsics guarantee full data synchronization 
  */
 #define synched_read(mem) *mem
 #define synched_write(mem, value) InterlockedExchange64(mem, value)
-#define synched_add(mem, delta) InterlockedAdd64(mem, delta)
+#define synched_add(mem, delta) InterlockedExchangeAdd64(mem, delta)
 #define synched_cmpxchg(mem, value, comperand) \
   InterlockedCompareExchange64(mem, value, comperand)
 



Mime
View raw message