summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--uisimulator/sdl/thread-sdl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/uisimulator/sdl/thread-sdl.c b/uisimulator/sdl/thread-sdl.c
index 41a60c9..587a5cc 100644
--- a/uisimulator/sdl/thread-sdl.c
+++ b/uisimulator/sdl/thread-sdl.c
@@ -46,7 +46,7 @@ void sim_sleep(int ticks)
int runthread(void *data)
{
- SDL_mutexV(m);
+ SDL_mutexP(m);
((void(*)())data) ();
SDL_mutexV(m);
return 0;
@@ -64,6 +64,8 @@ int create_thread(void (*fp)(void), void* sp, int stk_size)
threads[threadCount++] = SDL_CreateThread(runthread, fp);
+ yield();
+
return 0;
}