summaryrefslogtreecommitdiff
path: root/uisimulator/sdl/thread-sdl.c
diff options
context:
space:
mode:
Diffstat (limited to 'uisimulator/sdl/thread-sdl.c')
-rw-r--r--uisimulator/sdl/thread-sdl.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/uisimulator/sdl/thread-sdl.c b/uisimulator/sdl/thread-sdl.c
index a07ac29738..b8297072f2 100644
--- a/uisimulator/sdl/thread-sdl.c
+++ b/uisimulator/sdl/thread-sdl.c
@@ -157,6 +157,23 @@ bool thread_sdl_init(void *param)
157 return true; 157 return true;
158} 158}
159 159
160/* A way to yield and leave the threading system for extended periods */
161void thread_sdl_thread_lock(void *me)
162{
163 SDL_LockMutex(m);
164 running = (struct thread_entry *)me;
165
166 if (threads_exit)
167 remove_thread(NULL);
168}
169
170void * thread_sdl_thread_unlock(void)
171{
172 struct thread_entry *current = running;
173 SDL_UnlockMutex(m);
174 return current;
175}
176
160static int find_empty_thread_slot(void) 177static int find_empty_thread_slot(void)
161{ 178{
162 int n; 179 int n;