summaryrefslogtreecommitdiffstats
path: root/uisimulator
diff options
context:
space:
mode:
Diffstat (limited to 'uisimulator')
-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;
void yield(void)
{
+ static int counter = 0;
+
SDL_mutexV(m);
- SDL_Delay(1);
+ if (counter++ >= 5)
+ {
+ SDL_Delay(1);
+ counter = 0;
+ }
SDL_mutexP(m);
}