summaryrefslogtreecommitdiffstats
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.tar.bz2
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;
static int codec_thread_priority = PRIORITY_PLAYBACK;
#endif
-extern struct thread_entry *codec_thread_p;
+extern uintptr_t codec_thread_id;
/* Helpful macros for use in conditionals this assumes some of the above
* static variable names */
@@ -258,13 +258,13 @@ static void boost_codec_thread(bool boost)
if (priority != codec_thread_priority)
{
codec_thread_priority = priority;
- thread_set_priority(codec_thread_p, priority);
+ thread_set_priority(codec_thread_id, priority);
voice_thread_set_priority(priority);
}
}
else if (codec_thread_priority != PRIORITY_PLAYBACK)
{
- thread_set_priority(codec_thread_p, PRIORITY_PLAYBACK);
+ thread_set_priority(codec_thread_id, PRIORITY_PLAYBACK);
voice_thread_set_priority(PRIORITY_PLAYBACK);
codec_thread_priority = PRIORITY_PLAYBACK;
}
@@ -276,7 +276,7 @@ static void pcmbuf_under_watermark(void)
/* Only codec thread initiates boost - voice boosts the cpu when playing
a clip */
#ifndef SIMULATOR
- if (thread_get_current() == codec_thread_p)
+ if (thread_get_current() == codec_thread_id)
#endif /* SIMULATOR */
{
#ifdef HAVE_PRIORITY_SCHEDULING