From 8a82892e52127f50efaafaeda3ae841e8bbefe2d Mon Sep 17 00:00:00 2001 From: Brandon Low Date: Sat, 11 Nov 2006 05:33:24 +0000 Subject: Thread API enhancements. 1) block_thread -> block_thread + block_thread_w_tmo -- this call was always used in distinct ways so having one call with a conditional was ugly. 2) enhance Slasheri's scheduler controlled boost concept. now any thread may trigger a boost which will last until that thread next sleeps. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11509 a1c6a512-1295-4272-9138-f99709370657 --- apps/playback.c | 6 +++++- apps/tree.c | 4 +--- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'apps') diff --git a/apps/playback.c b/apps/playback.c index 6fed765da4..62dd039274 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -2151,7 +2151,11 @@ static bool audio_yield_codecs(void) while ((pcmbuf_is_crossfade_active() || pcmbuf_is_lowdata()) && !ci.stop_codec && playing && !audio_filebuf_is_lowdata()) { - sleep(1); + if (filling) + yield(); + else + sleep(2); + if (!queue_empty(&audio_queue)) return true; } diff --git a/apps/tree.c b/apps/tree.c index 6465b50e6f..623046a4b0 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -1229,7 +1229,7 @@ bool create_playlist(void) if (fd < 0) return false; - cpu_boost_id(true, CPUBOOSTID_TREE); + trigger_cpu_boost(); snprintf(filename, sizeof(filename), "%s", tc.currdir[1] ? tc.currdir : "/"); @@ -1237,8 +1237,6 @@ bool create_playlist(void) add_dir(filename, sizeof(filename), fd); close(fd); - cpu_boost_id(false, CPUBOOSTID_TREE); - sleep(HZ); return true; -- cgit v1.2.3