summaryrefslogtreecommitdiff
path: root/ptw32_InterlockedCompareExchange.c
diff options
context:
space:
mode:
authorrpj <rpj>2011-03-03 23:37:20 +0000
committerrpj <rpj>2011-03-03 23:37:20 +0000
commite470da85f7b9426eea03d66086c2822bf29e9b05 (patch)
treeb3747768258dc62752612327904be1f1067d5c7f /ptw32_InterlockedCompareExchange.c
parent1170175259781ece4a8d99d517230f4b9ecb7b50 (diff)
Some cleanups, mostly x86_64 compat plus interlocked macros
Diffstat (limited to 'ptw32_InterlockedCompareExchange.c')
-rw-r--r--ptw32_InterlockedCompareExchange.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/ptw32_InterlockedCompareExchange.c b/ptw32_InterlockedCompareExchange.c
index 898591d..74b9f15 100644
--- a/ptw32_InterlockedCompareExchange.c
+++ b/ptw32_InterlockedCompareExchange.c
@@ -35,6 +35,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
+#if 0
#ifndef _WIN64
#include "pthread.h"
@@ -154,6 +155,7 @@ ptw32_InterlockedCompareExchange (PTW32_INTERLOCKED_LPLONG location,
}
+#if 0
/*
* ptw32_InterlockedExchange --
*
@@ -207,8 +209,6 @@ ptw32_InterlockedExchange (LPLONG location,
* 'location' may have changed, in which case we will loop
* back to do the MOV again.
*
- * FIXME! Need memory barriers for the MOV+CMPXCHG combo?
- *
* Tests show that this routine has almost identical timing
* to Win32's InterlockedExchange(), which is much faster than
* using the inlined 'xchg' instruction above, so it's probably
@@ -249,8 +249,6 @@ L1: MOV eax,dword ptr [ecx]
* 'location' may have changed, in which case we will loop
* back to do the movl again.
*
- * FIXME! Need memory barriers for the MOV+CMPXCHG combo?
- *
* Tests show that this routine has almost identical timing
* to Win32's InterlockedExchange(), and is much faster than
* using an inlined 'xchg' instruction, so Win32 is probably
@@ -288,6 +286,7 @@ L1: MOV eax,dword ptr [ecx]
#endif
}
+#endif
#if 1
@@ -297,11 +296,16 @@ L1: MOV eax,dword ptr [ecx]
#define PTW32_INTERLOCKED_COMPARE_EXCHANGE ptw32_InterlockedCompareExchange
#endif
+#if 0
#if defined(PTW32_BUILD_INLINED) && defined(HAVE_INLINABLE_INTERLOCKED_XCHG)
#undef PTW32_INTERLOCKED_EXCHANGE
#define PTW32_INTERLOCKED_EXCHANGE ptw32_InterlockedExchange
#endif
+#endif
#endif
#endif
+
+#endif /* 0 */
+