aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMagnus Hagander <magnus@hagander.net>2010-01-04 17:10:24 +0000
committerMagnus Hagander <magnus@hagander.net>2010-01-04 17:10:24 +0000
commit305e85b0983e6e18d38d12a575b60ccb8102f4fe (patch)
tree379abddd57152ab93760b368840a3286b99eb520 /src
parent4c5b4c8bd00d27df22311c57ca4f0ebe1c562089 (diff)
downloadpostgresql-305e85b0983e6e18d38d12a575b60ccb8102f4fe.tar.gz
postgresql-305e85b0983e6e18d38d12a575b60ccb8102f4fe.zip
Add a Win64-specific spin_delay() function.
We can't use the same as before, since MSVC on Win64 doesn't support inline assembly.
Diffstat (limited to 'src')
-rw-r--r--src/include/storage/s_lock.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h
index 411dbf8c4ce..c6edb7a5e9e 100644
--- a/src/include/storage/s_lock.h
+++ b/src/include/storage/s_lock.h
@@ -66,7 +66,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/storage/s_lock.h,v 1.169 2010/01/02 16:58:08 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/storage/s_lock.h,v 1.170 2010/01/04 17:10:24 mha Exp $
*
*-------------------------------------------------------------------------
*/
@@ -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