Use _mm_pause() for win64 spin_delay(), per note from Tsutomu Yamada.

This commit is contained in:
Magnus Hagander 2010-01-05 11:06:28 +00:00
parent 5219f80312
commit ce92f8b463

View File

@ -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.170 2010/01/04 17:10:24 mha Exp $ * $PostgreSQL: pgsql/src/include/storage/s_lock.h,v 1.171 2010/01/05 11:06:28 mha Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -837,13 +837,13 @@ typedef LONG slock_t;
#define SPIN_DELAY() spin_delay() #define SPIN_DELAY() spin_delay()
/* If using Visual C++ on Win64, inline assembly is unavailable. /* If using Visual C++ on Win64, inline assembly is unavailable.
* Use a __nop instrinsic instead of rep nop. * Use a _mm_pause instrinsic instead of rep nop.
*/ */
#if defined(_WIN64) #if defined(_WIN64)
static __forceinline void static __forceinline void
spin_delay(void) spin_delay(void)
{ {
__nop(); _mm_pause();
} }
#else #else
static __forceinline void static __forceinline void