1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Michael Sevakis 2008-12-10 08:57:10 +00:00
parent 40ff47c7ee
commit 8cfbd3604f
32 changed files with 329 additions and 234 deletions

View file

@ -54,7 +54,7 @@
#define VOICE_SAMPLE_DEPTH 16 /* Sample depth in bits */
/* Voice thread variables */
static struct thread_entry *voice_thread_p = NULL;
static unsigned int voice_thread_id = 0;
static long voice_stack[0x7c0/sizeof(long)] IBSS_ATTR_VOICE_STACK;
static const char voice_thread_name[] = "voice";
@ -434,25 +434,25 @@ void voice_thread_init(void)
queue_init(&voice_queue, false);
mutex_init(&voice_mutex);
voice_thread_p = create_thread(voice_thread, voice_stack,
voice_thread_id = create_thread(voice_thread, voice_stack,
sizeof(voice_stack), CREATE_THREAD_FROZEN,
voice_thread_name IF_PRIO(, PRIORITY_PLAYBACK) IF_COP(, CPU));
queue_enable_queue_send(&voice_queue, &voice_queue_sender_list,
voice_thread_p);
voice_thread_id);
} /* voice_thread_init */
/* Unfreeze the voice thread */
void voice_thread_resume(void)
{
logf("Thawing voice thread");
thread_thaw(voice_thread_p);
thread_thaw(voice_thread_id);
}
#ifdef HAVE_PRIORITY_SCHEDULING
/* Set the voice thread priority */
void voice_thread_set_priority(int priority)
{
thread_set_priority(voice_thread_p, priority);
thread_set_priority(voice_thread_id, priority);
}
#endif