diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2008-12-10 08:57:10 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2008-12-10 08:57:10 +0000 |
commit | 8cfbd3604fac14f629244e521ad24ffa9938c790 (patch) | |
tree | 16dc096519b8b537bb7d4b73e0c97f5f33ee752b /apps/playback.c | |
parent | 40ff47c7eea41ac893d7af5c5b97ace52a5ffade (diff) | |
download | rockbox-8cfbd3604fac14f629244e521ad24ffa9938c790.tar.gz 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/playback.c')
-rw-r--r-- | apps/playback.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/apps/playback.c b/apps/playback.c index 50c4017200..3aed12e918 100644 --- a/apps/playback.c +++ b/apps/playback.c | |||
@@ -299,7 +299,7 @@ static struct queue_sender_list codec_queue_sender_list; | |||
299 | static long codec_stack[(DEFAULT_STACK_SIZE + 0x2000)/sizeof(long)] | 299 | static long codec_stack[(DEFAULT_STACK_SIZE + 0x2000)/sizeof(long)] |
300 | IBSS_ATTR; | 300 | IBSS_ATTR; |
301 | static const char codec_thread_name[] = "codec"; | 301 | static const char codec_thread_name[] = "codec"; |
302 | struct thread_entry *codec_thread_p; /* For modifying thread priority later. */ | 302 | unsigned int codec_thread_id; /* For modifying thread priority later. */ |
303 | 303 | ||
304 | /* PCM buffer messaging */ | 304 | /* PCM buffer messaging */ |
305 | static struct event_queue pcmbuf_queue SHAREDBSS_ATTR; | 305 | static struct event_queue pcmbuf_queue SHAREDBSS_ATTR; |
@@ -2499,7 +2499,7 @@ static void audio_thread(void) | |||
2499 | */ | 2499 | */ |
2500 | void audio_init(void) | 2500 | void audio_init(void) |
2501 | { | 2501 | { |
2502 | struct thread_entry *audio_thread_p; | 2502 | unsigned int audio_thread_id; |
2503 | 2503 | ||
2504 | /* Can never do this twice */ | 2504 | /* Can never do this twice */ |
2505 | if (audio_is_initialized) | 2505 | if (audio_is_initialized) |
@@ -2543,22 +2543,22 @@ void audio_init(void) | |||
2543 | talk first */ | 2543 | talk first */ |
2544 | talk_init(); | 2544 | talk_init(); |
2545 | 2545 | ||
2546 | codec_thread_p = create_thread( | 2546 | codec_thread_id = create_thread( |
2547 | codec_thread, codec_stack, sizeof(codec_stack), | 2547 | codec_thread, codec_stack, sizeof(codec_stack), |
2548 | CREATE_THREAD_FROZEN, | 2548 | CREATE_THREAD_FROZEN, |
2549 | codec_thread_name IF_PRIO(, PRIORITY_PLAYBACK) | 2549 | codec_thread_name IF_PRIO(, PRIORITY_PLAYBACK) |
2550 | IF_COP(, CPU)); | 2550 | IF_COP(, CPU)); |
2551 | 2551 | ||
2552 | queue_enable_queue_send(&codec_queue, &codec_queue_sender_list, | 2552 | queue_enable_queue_send(&codec_queue, &codec_queue_sender_list, |
2553 | codec_thread_p); | 2553 | codec_thread_id); |
2554 | 2554 | ||
2555 | audio_thread_p = create_thread(audio_thread, audio_stack, | 2555 | audio_thread_id = create_thread(audio_thread, audio_stack, |
2556 | sizeof(audio_stack), CREATE_THREAD_FROZEN, | 2556 | sizeof(audio_stack), CREATE_THREAD_FROZEN, |
2557 | audio_thread_name IF_PRIO(, PRIORITY_USER_INTERFACE) | 2557 | audio_thread_name IF_PRIO(, PRIORITY_USER_INTERFACE) |
2558 | IF_COP(, CPU)); | 2558 | IF_COP(, CPU)); |
2559 | 2559 | ||
2560 | queue_enable_queue_send(&audio_queue, &audio_queue_sender_list, | 2560 | queue_enable_queue_send(&audio_queue, &audio_queue_sender_list, |
2561 | audio_thread_p); | 2561 | audio_thread_id); |
2562 | 2562 | ||
2563 | #ifdef PLAYBACK_VOICE | 2563 | #ifdef PLAYBACK_VOICE |
2564 | voice_thread_init(); | 2564 | voice_thread_init(); |
@@ -2599,8 +2599,8 @@ void audio_init(void) | |||
2599 | #ifdef PLAYBACK_VOICE | 2599 | #ifdef PLAYBACK_VOICE |
2600 | voice_thread_resume(); | 2600 | voice_thread_resume(); |
2601 | #endif | 2601 | #endif |
2602 | thread_thaw(codec_thread_p); | 2602 | thread_thaw(codec_thread_id); |
2603 | thread_thaw(audio_thread_p); | 2603 | thread_thaw(audio_thread_id); |
2604 | 2604 | ||
2605 | } /* audio_init */ | 2605 | } /* audio_init */ |
2606 | 2606 | ||