From eb6d1aca466d033ffbaf6aa209f6b3c7fca8b9f5 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Mon, 4 Jan 2010 17:10:24 +0000 Subject: [PATCH] Add a Win64-specific spin_delay() function. We can't use the same as before, since MSVC on Win64 doesn't support inline assembly. --- src/include/storage/s_lock.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h index d5d7db7ab9..ac2ba6e96c 100644 --- a/src/include/storage/s_lock.h +++ b/src/include/storage/s_lock.h @@ -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 -- 2.39.5