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/codecs/mpa.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'apps/codecs/mpa.c') diff --git a/apps/codecs/mpa.c b/apps/codecs/mpa.c index 7732622383..37a1afadfa 100644 --- a/apps/codecs/mpa.c +++ b/apps/codecs/mpa.c @@ -200,7 +200,7 @@ static void set_elapsed(struct mp3entry* id3) static int mad_synth_thread_stack[DEFAULT_STACK_SIZE/sizeof(int)/2] IBSS_ATTR; static const unsigned char * const mad_synth_thread_name = "mp3dec"; -static struct thread_entry *mad_synth_thread_p; +static unsigned int mad_synth_thread_id = 0; static void mad_synth_thread(void) @@ -249,14 +249,14 @@ static bool mad_synth_thread_create(void) ci->semaphore_init(&synth_done_sem, 1, 0); ci->semaphore_init(&synth_pending_sem, 1, 0); - mad_synth_thread_p = ci->create_thread(mad_synth_thread, + mad_synth_thread_id = ci->create_thread(mad_synth_thread, mad_synth_thread_stack, sizeof(mad_synth_thread_stack), 0, mad_synth_thread_name IF_PRIO(, PRIORITY_PLAYBACK) IF_COP(, COP)); - if (mad_synth_thread_p == NULL) + if (mad_synth_thread_id == 0) return false; return true; @@ -267,7 +267,7 @@ static void mad_synth_thread_quit(void) /*mop up COP thread*/ die=1; ci->semaphore_release(&synth_pending_sem); - ci->thread_wait(mad_synth_thread_p); + ci->thread_wait(mad_synth_thread_id); invalidate_icache(); } #else -- cgit v1.2.3