summaryrefslogtreecommitdiffstats
path: root/uisimulator/sdl/thread-sdl.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2007-09-13 21:40:56 +0000
committerMichael Sevakis <jethead71@rockbox.org>2007-09-13 21:40:56 +0000
commit4117c64917db87e2d6b47a0efe62cc1f13d6cafb (patch)
tree68d86915a68f244c30a043e8759f03d328a2e180 /uisimulator/sdl/thread-sdl.c
parent5128080328b74f78ff8e03a4fc4b3d0f4b305601 (diff)
downloadrockbox-4117c64917db87e2d6b47a0efe62cc1f13d6cafb.tar.gz
rockbox-4117c64917db87e2d6b47a0efe62cc1f13d6cafb.tar.bz2
rockbox-4117c64917db87e2d6b47a0efe62cc1f13d6cafb.zip
UISIMULATOR: Trying to make it snappy for everyone. Remove forced thread yield in switch_thread which starves threads that call it alot especially on fast 64-bit machines (which could yield _alot_ of time away). I suspect that was a way to get I/O to run better before having an I/O thread...and it did help before that addition. No longer needed it seems and the OS seems to handle scheduling without hints just fine.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14685 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator/sdl/thread-sdl.c')
-rw-r--r--uisimulator/sdl/thread-sdl.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/uisimulator/sdl/thread-sdl.c b/uisimulator/sdl/thread-sdl.c
index ea8bb39360..0bd7d2534e 100644
--- a/uisimulator/sdl/thread-sdl.c
+++ b/uisimulator/sdl/thread-sdl.c
@@ -225,17 +225,10 @@ void thread_sdl_unlock(void)
void switch_thread(bool save_context, struct thread_entry **blocked_list)
{
- static int counter = 0;
struct thread_entry *current = running;
SDL_UnlockMutex(m);
-
- if (counter++ >= 50)
- {
- SDL_Delay(0);
- counter = 0;
- }
-
+ /* Any other thread waiting already will get it first */
SDL_LockMutex(m);
running = current;