summaryrefslogtreecommitdiffstats
path: root/uisimulator/sdl/kernel.c
diff options
context:
space:
mode:
Diffstat (limited to 'uisimulator/sdl/kernel.c')
-rw-r--r--uisimulator/sdl/kernel.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/uisimulator/sdl/kernel.c b/uisimulator/sdl/kernel.c
index dddfa70066..e01fbe65b9 100644
--- a/uisimulator/sdl/kernel.c
+++ b/uisimulator/sdl/kernel.c
@@ -355,3 +355,15 @@ void mutex_unlock(struct mutex *m)
{
m->locked = false;
}
+
+void spinlock_lock(struct mutex *m)
+{
+ while(m->locked)
+ switch_thread(true, NULL);
+ m->locked = true;
+}
+
+void spinlock_unlock(struct mutex *m)
+{
+ m->locked = false;
+}