diff options
author | Brandon Low <lostlogic@rockbox.org> | 2006-11-11 05:33:24 +0000 |
---|---|---|
committer | Brandon Low <lostlogic@rockbox.org> | 2006-11-11 05:33:24 +0000 |
commit | 8a82892e52127f50efaafaeda3ae841e8bbefe2d (patch) | |
tree | 1dfa1a18c05018045db4fe8e67d1dc3fbc5a2d72 /apps | |
parent | 806d8f3505ef7e477f9af4d1b07fe30cd1f28fb3 (diff) | |
download | rockbox-8a82892e52127f50efaafaeda3ae841e8bbefe2d.tar.gz rockbox-8a82892e52127f50efaafaeda3ae841e8bbefe2d.zip |
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
Diffstat (limited to 'apps')
-rw-r--r-- | apps/playback.c | 6 | ||||
-rw-r--r-- | apps/tree.c | 4 |
2 files changed, 6 insertions, 4 deletions
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) | |||
2151 | while ((pcmbuf_is_crossfade_active() || pcmbuf_is_lowdata()) | 2151 | while ((pcmbuf_is_crossfade_active() || pcmbuf_is_lowdata()) |
2152 | && !ci.stop_codec && playing && !audio_filebuf_is_lowdata()) | 2152 | && !ci.stop_codec && playing && !audio_filebuf_is_lowdata()) |
2153 | { | 2153 | { |
2154 | sleep(1); | 2154 | if (filling) |
2155 | yield(); | ||
2156 | else | ||
2157 | sleep(2); | ||
2158 | |||
2155 | if (!queue_empty(&audio_queue)) | 2159 | if (!queue_empty(&audio_queue)) |
2156 | return true; | 2160 | return true; |
2157 | } | 2161 | } |
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) | |||
1229 | if (fd < 0) | 1229 | if (fd < 0) |
1230 | return false; | 1230 | return false; |
1231 | 1231 | ||
1232 | cpu_boost_id(true, CPUBOOSTID_TREE); | 1232 | trigger_cpu_boost(); |
1233 | 1233 | ||
1234 | snprintf(filename, sizeof(filename), "%s", | 1234 | snprintf(filename, sizeof(filename), "%s", |
1235 | tc.currdir[1] ? tc.currdir : "/"); | 1235 | tc.currdir[1] ? tc.currdir : "/"); |
@@ -1237,8 +1237,6 @@ bool create_playlist(void) | |||
1237 | add_dir(filename, sizeof(filename), fd); | 1237 | add_dir(filename, sizeof(filename), fd); |
1238 | close(fd); | 1238 | close(fd); |
1239 | 1239 | ||
1240 | cpu_boost_id(false, CPUBOOSTID_TREE); | ||
1241 | |||
1242 | sleep(HZ); | 1240 | sleep(HZ); |
1243 | 1241 | ||
1244 | return true; | 1242 | return true; |