summaryrefslogtreecommitdiff
path: root/apps/plugins/test_sampr.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/plugins/test_sampr.c
parent40ff47c7eea41ac893d7af5c5b97ace52a5ffade (diff)
downloadrockbox-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/plugins/test_sampr.c')
-rw-r--r--apps/plugins/test_sampr.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/apps/plugins/test_sampr.c b/apps/plugins/test_sampr.c
index 77f9b8a779..1131a7a989 100644
--- a/apps/plugins/test_sampr.c
+++ b/apps/plugins/test_sampr.c
@@ -39,7 +39,7 @@ static unsigned long hw_sampr IDATA_ATTR = HW_SAMPR_DEFAULT;
39 39
40static int gen_thread_stack[DEFAULT_STACK_SIZE/sizeof(int)] IBSS_ATTR; 40static int gen_thread_stack[DEFAULT_STACK_SIZE/sizeof(int)] IBSS_ATTR;
41static bool gen_quit IBSS_ATTR; 41static bool gen_quit IBSS_ATTR;
42static struct thread_entry *gen_thread_p; 42static unsigned int gen_thread_id;
43 43
44#define OUTPUT_CHUNK_COUNT (1 << 1) 44#define OUTPUT_CHUNK_COUNT (1 << 1)
45#define OUTPUT_CHUNK_MASK (OUTPUT_CHUNK_COUNT-1) 45#define OUTPUT_CHUNK_MASK (OUTPUT_CHUNK_COUNT-1)
@@ -233,11 +233,11 @@ static void play_tone(bool volume_set)
233 output_clear(); 233 output_clear();
234 update_gen_step(); 234 update_gen_step();
235 235
236 gen_thread_p = rb->create_thread(gen_thread_func, gen_thread_stack, 236 gen_thread_id = rb->create_thread(gen_thread_func, gen_thread_stack,
237 sizeof(gen_thread_stack), 0, 237 sizeof(gen_thread_stack), 0,
238 "test_sampr generator" 238 "test_sampr generator"
239 IF_PRIO(, PRIORITY_PLAYBACK) 239 IF_PRIO(, PRIORITY_PLAYBACK)
240 IF_COP(, CPU)); 240 IF_COP(, CPU));
241 241
242 rb->pcm_play_data(get_more, NULL, 0); 242 rb->pcm_play_data(get_more, NULL, 0);
243 243
@@ -260,7 +260,7 @@ static void play_tone(bool volume_set)
260 260
261 gen_quit = true; 261 gen_quit = true;
262 262
263 rb->thread_wait(gen_thread_p); 263 rb->thread_wait(gen_thread_id);
264 264
265 rb->pcm_play_stop(); 265 rb->pcm_play_stop();
266 266