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/buffering.c | |
| parent | 40ff47c7eea41ac893d7af5c5b97ace52a5ffade (diff) | |
| download | rockbox-8cfbd3604fac14f629244e521ad24ffa9938c790.zip rockbox-8cfbd3604fac14f629244e521ad24ffa9938c790.tar.gz rockbox-8cfbd3604fac14f629244e521ad24ffa9938c790.tar.bz2 rockbox-8cfbd3604fac14f629244e521ad24ffa9938c790.tar.xz | |
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/buffering.c')
| -rw-r--r-- | apps/buffering.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/buffering.c b/apps/buffering.c index dfc9006..6160869 100644 --- a/apps/buffering.c +++ b/apps/buffering.c @@ -184,7 +184,7 @@ enum { static void buffering_thread(void); static long buffering_stack[(DEFAULT_STACK_SIZE + 0x2000)/sizeof(long)]; static const char buffering_thread_name[] = "buffering"; -static struct thread_entry *buffering_thread_p; +static unsigned int buffering_thread_id = 0; static struct event_queue buffering_queue; static struct queue_sender_list buffering_queue_sender_list; @@ -1468,13 +1468,13 @@ void buffering_init(void) conf_watermark = BUFFERING_DEFAULT_WATERMARK; queue_init(&buffering_queue, true); - buffering_thread_p = create_thread( buffering_thread, buffering_stack, + buffering_thread_id = create_thread( buffering_thread, buffering_stack, sizeof(buffering_stack), CREATE_THREAD_FROZEN, buffering_thread_name IF_PRIO(, PRIORITY_BUFFERING) IF_COP(, CPU)); queue_enable_queue_send(&buffering_queue, &buffering_queue_sender_list, - buffering_thread_p); + buffering_thread_id); } /* Initialise the buffering subsystem */ @@ -1501,7 +1501,7 @@ bool buffering_reset(char *buf, size_t buflen) high_watermark = 3*buflen / 4; #endif - thread_thaw(buffering_thread_p); + thread_thaw(buffering_thread_id); return true; } |