projects
/
users
/
andresfreund
/
postgres.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8c43d32
)
Add a Win64-specific spin_delay() function.
author
Magnus Hagander
<
[email protected]
>
Mon, 4 Jan 2010 17:10:24 +0000
(17:10 +0000)
committer
Magnus 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
patch
|
blob
|
blame
|
history
diff --git
a/src/include/storage/s_lock.h
b/src/include/storage/s_lock.h
index d5d7db7ab936e68fd91ba03fc603b2cc8d981769..ac2ba6e96c480eb76c619e2e6c0188260d78a76f 100644
(file)
--- 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