[vlc-devel] [PATCH] win32: only sleep for 0 ms when excplicitly requested

Steve Lhomme robux4 at videolabs.io
Tue May 31 15:06:19 CEST 2016


SleepEx(0) results in 100% CPU usage on XP. It's back to normal with a 10 ms
value.
---
 src/win32/thread.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/win32/thread.c b/src/win32/thread.c
index 01a8a46..9d8870c 100644
--- a/src/win32/thread.c
+++ b/src/win32/thread.c
@@ -360,7 +360,7 @@ static BOOL WINAPI SleepConditionVariableFallback(CONDITION_VARIABLE *cv,
 {
     (void) cv;
     LeaveCriticalSection(cs);
-    SleepEx(0, TRUE);
+    SleepEx(ms > 10 ? 10 : ms, TRUE);
     EnterCriticalSection(cs);
     return ms != 0;
 }
-- 
2.7.0



More information about the vlc-devel mailing list