From 8cfbd3604fac14f629244e521ad24ffa9938c790 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Wed, 10 Dec 2008 08:57:10 +0000 Subject: 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 --- apps/pcmbuf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'apps/pcmbuf.c') 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 -- cgit v1.2.3