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.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/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 dfc90065d6..6160869498 100644 --- a/apps/buffering.c +++ b/apps/buffering.c | |||
@@ -184,7 +184,7 @@ enum { | |||
184 | static void buffering_thread(void); | 184 | static void buffering_thread(void); |
185 | static long buffering_stack[(DEFAULT_STACK_SIZE + 0x2000)/sizeof(long)]; | 185 | static long buffering_stack[(DEFAULT_STACK_SIZE + 0x2000)/sizeof(long)]; |
186 | static const char buffering_thread_name[] = "buffering"; | 186 | static const char buffering_thread_name[] = "buffering"; |
187 | static struct thread_entry *buffering_thread_p; | 187 | static unsigned int buffering_thread_id = 0; |
188 | static struct event_queue buffering_queue; | 188 | static struct event_queue buffering_queue; |
189 | static struct queue_sender_list buffering_queue_sender_list; | 189 | static struct queue_sender_list buffering_queue_sender_list; |
190 | 190 | ||
@@ -1468,13 +1468,13 @@ void buffering_init(void) | |||
1468 | conf_watermark = BUFFERING_DEFAULT_WATERMARK; | 1468 | conf_watermark = BUFFERING_DEFAULT_WATERMARK; |
1469 | 1469 | ||
1470 | queue_init(&buffering_queue, true); | 1470 | queue_init(&buffering_queue, true); |
1471 | buffering_thread_p = create_thread( buffering_thread, buffering_stack, | 1471 | buffering_thread_id = create_thread( buffering_thread, buffering_stack, |
1472 | sizeof(buffering_stack), CREATE_THREAD_FROZEN, | 1472 | sizeof(buffering_stack), CREATE_THREAD_FROZEN, |
1473 | buffering_thread_name IF_PRIO(, PRIORITY_BUFFERING) | 1473 | buffering_thread_name IF_PRIO(, PRIORITY_BUFFERING) |
1474 | IF_COP(, CPU)); | 1474 | IF_COP(, CPU)); |
1475 | 1475 | ||
1476 | queue_enable_queue_send(&buffering_queue, &buffering_queue_sender_list, | 1476 | queue_enable_queue_send(&buffering_queue, &buffering_queue_sender_list, |
1477 | buffering_thread_p); | 1477 | buffering_thread_id); |
1478 | } | 1478 | } |
1479 | 1479 | ||
1480 | /* Initialise the buffering subsystem */ | 1480 | /* Initialise the buffering subsystem */ |
@@ -1501,7 +1501,7 @@ bool buffering_reset(char *buf, size_t buflen) | |||
1501 | high_watermark = 3*buflen / 4; | 1501 | high_watermark = 3*buflen / 4; |
1502 | #endif | 1502 | #endif |
1503 | 1503 | ||
1504 | thread_thaw(buffering_thread_p); | 1504 | thread_thaw(buffering_thread_id); |
1505 | 1505 | ||
1506 | return true; | 1506 | return true; |
1507 | } | 1507 | } |