summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/CREDITS1
-rw-r--r--uisimulator/sdl/kernel.c11
2 files changed, 8 insertions, 4 deletions
diff --git a/docs/CREDITS b/docs/CREDITS
index 4c25a97..2f1d451 100644
--- a/docs/CREDITS
+++ b/docs/CREDITS
@@ -197,3 +197,4 @@ Rani Hod
Tom Ross
Anton Romanov
Jean-Luc Ohl
+Steve Bavin
diff --git a/uisimulator/sdl/kernel.c b/uisimulator/sdl/kernel.c
index c17dc49..b9ffe0e 100644
--- a/uisimulator/sdl/kernel.c
+++ b/uisimulator/sdl/kernel.c
@@ -150,18 +150,21 @@ int tick_remove_task(void (*f)(void))
return -1;
}
-/* TODO: Implement mutexes for win32 */
+/* Very simple mutex simulation - won't work with pre-emptive
+ multitasking, but is better than nothing at all */
void mutex_init(struct mutex *m)
{
- (void)m;
+ m->locked = false;
}
void mutex_lock(struct mutex *m)
{
- (void)m;
+ while(m->locked)
+ switch_thread();
+ m->locked = true;
}
void mutex_unlock(struct mutex *m)
{
- (void)m;
+ m->locked = false;
}