diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2007-09-13 21:40:56 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2007-09-13 21:40:56 +0000 |
commit | 4117c64917db87e2d6b47a0efe62cc1f13d6cafb (patch) | |
tree | 68d86915a68f244c30a043e8759f03d328a2e180 /uisimulator/sdl | |
parent | 5128080328b74f78ff8e03a4fc4b3d0f4b305601 (diff) | |
download | rockbox-4117c64917db87e2d6b47a0efe62cc1f13d6cafb.tar.gz 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')
-rw-r--r-- | uisimulator/sdl/thread-sdl.c | 9 |
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) | |||
225 | 225 | ||
226 | void switch_thread(bool save_context, struct thread_entry **blocked_list) | 226 | void switch_thread(bool save_context, struct thread_entry **blocked_list) |
227 | { | 227 | { |
228 | static int counter = 0; | ||
229 | struct thread_entry *current = running; | 228 | struct thread_entry *current = running; |
230 | 229 | ||
231 | SDL_UnlockMutex(m); | 230 | SDL_UnlockMutex(m); |
232 | 231 | /* Any other thread waiting already will get it first */ | |
233 | if (counter++ >= 50) | ||
234 | { | ||
235 | SDL_Delay(0); | ||
236 | counter = 0; | ||
237 | } | ||
238 | |||
239 | SDL_LockMutex(m); | 232 | SDL_LockMutex(m); |
240 | running = current; | 233 | running = current; |
241 | 234 | ||