[PATCH] ntdll: Use YieldProcessor() in RtlEnterCriticalSection().

Zebediah Figura zfigura at codeweavers.com
Mon Feb 14 19:59:02 CST 2022


Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
---
 dlls/ntdll/sync.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/dlls/ntdll/sync.c b/dlls/ntdll/sync.c
index 06b594c633f..43864325b35 100644
--- a/dlls/ntdll/sync.c
+++ b/dlls/ntdll/sync.c
@@ -373,15 +373,6 @@ NTSTATUS WINAPI RtlpUnWaitCriticalSection( RTL_CRITICAL_SECTION *crit )
 }
 
 
-static inline void small_pause(void)
-{
-#ifdef __i386__
-    __asm__ __volatile__( "rep;nop" : : : "memory" );
-#else
-    __asm__ __volatile__( "" : : : "memory" );
-#endif
-}
-
 /******************************************************************************
  *      RtlEnterCriticalSection   (NTDLL.@)
  */
@@ -399,7 +390,7 @@ NTSTATUS WINAPI RtlEnterCriticalSection( RTL_CRITICAL_SECTION *crit )
             {
                 if (InterlockedCompareExchange( &crit->LockCount, 0, -1 ) == -1) goto done;
             }
-            small_pause();
+            YieldProcessor();
         }
     }
 
-- 
2.34.1




More information about the wine-devel mailing list