diff --git a/include/winnt.h b/include/winnt.h index d8abb8bde70..83f03b62ade 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -7154,6 +7154,19 @@ static FORCEINLINE void MemoryBarrier(void) #endif /* __GNUC__ */ +static FORCEINLINE void YieldProcessor(void) +{ +#ifdef __GNUC__ +#if defined(__i386__) || defined(__x86_64__) + __asm__ __volatile__( "rep; nop" : : : "memory" ); +#elif defined(__arm__) || defined(__aarch64__) + __asm__ __volatile__( "dmb ishst\n\tyield" : : : "memory" ); +#else + __asm__ __volatile__( "" : : : "memory" ); +#endif +#endif +} + #ifdef __cplusplus } #endif