Add a Win64-specific spin_delay() function.
authorMagnus Hagander <[email protected]>
Mon, 4 Jan 2010 17:10:24 +0000 (17:10 +0000)
committerMagnus Hagander <[email protected]>
Mon, 4 Jan 2010 17:10:24 +0000 (17:10 +0000)
We can't use the same as before, since MSVC on Win64 doesn't
support inline assembly.

src/include/storage/s_lock.h

index d5d7db7ab936e68fd91ba03fc603b2cc8d981769..ac2ba6e96c480eb76c619e2e6c0188260d78a76f 100644 (file)
@@ -836,12 +836,23 @@ typedef LONG slock_t;
 
 #define SPIN_DELAY() spin_delay()
 
+/* If using Visual C++ on Win64, inline assembly is unavailable.
+ * Use a __nop instrinsic instead of rep nop.
+ */
+#if defined(_WIN64)
+static __forceinline void
+spin_delay(void)
+{
+   __nop();
+}
+#else
 static __forceinline void
 spin_delay(void)
 {
    /* See comment for gcc code. Same code, MASM syntax */
    __asm rep nop;
 }
+#endif
 
 #endif