Zebediah Figura : ntdll: Use YieldProcessor() in RtlEnterCriticalSection().

Alexandre Julliard julliard at winehq.org
Tue Feb 15 16:07:16 CST 2022


Module: wine
Branch: master
Commit: 615a2ab53c9d9ecacd2c50e3c7fb9ab138bf1a1c
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=615a2ab53c9d9ecacd2c50e3c7fb9ab138bf1a1c

Author: Zebediah Figura <zfigura at codeweavers.com>
Date:   Mon Feb 14 19:59:02 2022 -0600

ntdll: Use YieldProcessor() in RtlEnterCriticalSection().

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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();
         }
     }
 




More information about the wine-cvs mailing list