summaryrefslogtreecommitdiff
path: root/apps/pcmbuf.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2008-12-10 08:57:10 +0000
committerMichael Sevakis <jethead71@rockbox.org>2008-12-10 08:57:10 +0000
commit8cfbd3604fac14f629244e521ad24ffa9938c790 (patch)
tree16dc096519b8b537bb7d4b73e0c97f5f33ee752b /apps/pcmbuf.c
parent40ff47c7eea41ac893d7af5c5b97ace52a5ffade (diff)
downloadrockbox-8cfbd3604fac14f629244e521ad24ffa9938c790.tar.gz
rockbox-8cfbd3604fac14f629244e521ad24ffa9938c790.zip
Use cookies for thread identification instead of pointers directly which gives a buffer against wrongly identifying a thread when the slot is recycled (which has been nagging me for awhile). A slot gets 255 uses before it repeats. Everything gets incompatible so a full update is required.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19377 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/pcmbuf.c')
-rw-r--r--apps/pcmbuf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/pcmbuf.c b/apps/pcmbuf.c
index c7db4d3101..9ca5fbf5cf 100644
--- a/apps/pcmbuf.c
+++ b/apps/pcmbuf.c
@@ -115,7 +115,7 @@ static bool pcmbuf_flush;
115static int codec_thread_priority = PRIORITY_PLAYBACK; 115static int codec_thread_priority = PRIORITY_PLAYBACK;
116#endif 116#endif
117 117
118extern struct thread_entry *codec_thread_p; 118extern uintptr_t codec_thread_id;
119 119
120/* Helpful macros for use in conditionals this assumes some of the above 120/* Helpful macros for use in conditionals this assumes some of the above
121 * static variable names */ 121 * static variable names */
@@ -258,13 +258,13 @@ static void boost_codec_thread(bool boost)
258 if (priority != codec_thread_priority) 258 if (priority != codec_thread_priority)
259 { 259 {
260 codec_thread_priority = priority; 260 codec_thread_priority = priority;
261 thread_set_priority(codec_thread_p, priority); 261 thread_set_priority(codec_thread_id, priority);
262 voice_thread_set_priority(priority); 262 voice_thread_set_priority(priority);
263 } 263 }
264 } 264 }
265 else if (codec_thread_priority != PRIORITY_PLAYBACK) 265 else if (codec_thread_priority != PRIORITY_PLAYBACK)
266 { 266 {
267 thread_set_priority(codec_thread_p, PRIORITY_PLAYBACK); 267 thread_set_priority(codec_thread_id, PRIORITY_PLAYBACK);
268 voice_thread_set_priority(PRIORITY_PLAYBACK); 268 voice_thread_set_priority(PRIORITY_PLAYBACK);
269 codec_thread_priority = PRIORITY_PLAYBACK; 269 codec_thread_priority = PRIORITY_PLAYBACK;
270 } 270 }
@@ -276,7 +276,7 @@ static void pcmbuf_under_watermark(void)
276 /* Only codec thread initiates boost - voice boosts the cpu when playing 276 /* Only codec thread initiates boost - voice boosts the cpu when playing
277 a clip */ 277 a clip */
278#ifndef SIMULATOR 278#ifndef SIMULATOR
279 if (thread_get_current() == codec_thread_p) 279 if (thread_get_current() == codec_thread_id)
280#endif /* SIMULATOR */ 280#endif /* SIMULATOR */
281 { 281 {
282#ifdef HAVE_PRIORITY_SCHEDULING 282#ifdef HAVE_PRIORITY_SCHEDULING