From dee43ece2086e15894934b754e47cb7ce5882cda Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Fri, 9 Mar 2007 08:03:18 +0000 Subject: 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 --- uisimulator/sdl/kernel.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'uisimulator') 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; +} -- cgit v1.2.3