mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-10-03 04:26:52 +02:00
Add a Win64-specific spin_delay() function.
We can't use the same as before, since MSVC on Win64 doesn't support inline assembly.
This commit is contained in:
parent
4c5b4c8bd0
commit
305e85b098
@ -66,7 +66,7 @@
|
|||||||
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* 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()
|
#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
|
static __forceinline void
|
||||||
spin_delay(void)
|
spin_delay(void)
|
||||||
{
|
{
|
||||||
/* See comment for gcc code. Same code, MASM syntax */
|
/* See comment for gcc code. Same code, MASM syntax */
|
||||||
__asm rep nop;
|
__asm rep nop;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user