Skip to content

Commit 305e85b

Browse files
committed
Add a Win64-specific spin_delay() function.
We can't use the same as before, since MSVC on Win64 doesn't support inline assembly.
1 parent 4c5b4c8 commit 305e85b

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/include/storage/s_lock.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
6767
* Portions Copyright (c) 1994, Regents of the University of California
6868
*
69-
* $PostgreSQL: pgsql/src/include/storage/s_lock.h,v 1.169 2010/01/02 16:58:08 momjian Exp $
69+
* $PostgreSQL: pgsql/src/include/storage/s_lock.h,v 1.170 2010/01/04 17:10:24 mha Exp $
7070
*
7171
*-------------------------------------------------------------------------
7272
*/
@@ -836,12 +836,23 @@ typedef LONG slock_t;
836836

837837
#define SPIN_DELAY() spin_delay()
838838

839+
/* If using Visual C++ on Win64, inline assembly is unavailable.
840+
* Use a __nop instrinsic instead of rep nop.
841+
*/
842+
#if defined(_WIN64)
843+
static __forceinline void
844+
spin_delay(void)
845+
{
846+
__nop();
847+
}
848+
#else
839849
static __forceinline void
840850
spin_delay(void)
841851
{
842852
/* See comment for gcc code. Same code, MASM syntax */
843853
__asm rep nop;
844854
}
855+
#endif
845856

846857
#endif
847858

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy