diff --git a/uisimulator/sdl/thread-sdl.c b/uisimulator/sdl/thread-sdl.c index 41a60c9bc5..587a5cc868 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; }