summaryrefslogtreecommitdiffstats
path: root/uisimulator/sdl/kernel.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2007-03-09 08:03:18 +0000
committerMichael Sevakis <jethead71@rockbox.org>2007-03-09 08:03:18 +0000
commitdee43ece2086e15894934b754e47cb7ce5882cda (patch)
tree9238a5c80fe4382975387ec90eca61bda8d4ed8f /uisimulator/sdl/kernel.c
parentf4b83e68594f076cdfe510cd2e23b7f57fd158b5 (diff)
downloadrockbox-dee43ece2086e15894934b754e47cb7ce5882cda.tar.gz
rockbox-dee43ece2086e15894934b754e47cb7ce5882cda.tar.bz2
rockbox-dee43ece2086e15894934b754e47cb7ce5882cda.zip
Put an end to priority inversion in the ata driver. Gave up trying to have fully atomic dual use mutexes so just replaced the ata driver locking with spins. Maybe I'll have better luck later. Things should run smoothly with database updates and such happening in the background.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12688 a1c6a512-1295-4272-9138-f99709370657
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;
+}