summaryrefslogtreecommitdiff
path: root/apps/voice_thread.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/voice_thread.c
parent40ff47c7eea41ac893d7af5c5b97ace52a5ffade (diff)
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/voice_thread.c')
-rw-r--r--apps/voice_thread.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/voice_thread.c b/apps/voice_thread.c
index 084c3872c6..86e80cece3 100644
--- a/apps/voice_thread.c
+++ b/apps/voice_thread.c
@@ -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