summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--uisimulator/sdl/thread-sdl.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/uisimulator/sdl/thread-sdl.c b/uisimulator/sdl/thread-sdl.c
index 587a5cc868..9377ba5219 100644
--- a/uisimulator/sdl/thread-sdl.c
+++ b/uisimulator/sdl/thread-sdl.c
@@ -32,8 +32,14 @@ SDL_mutex *m;
32 32
33void yield(void) 33void yield(void)
34{ 34{
35 static int counter = 0;
36
35 SDL_mutexV(m); 37 SDL_mutexV(m);
36 SDL_Delay(1); 38 if (counter++ >= 5)
39 {
40 SDL_Delay(1);
41 counter = 0;
42 }
37 SDL_mutexP(m); 43 SDL_mutexP(m);
38} 44}
39 45