summaryrefslogtreecommitdiff
path: root/apps/plugins/battery_bench.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/battery_bench.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/battery_bench.c')
-rw-r--r--apps/plugins/battery_bench.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/plugins/battery_bench.c b/apps/plugins/battery_bench.c
index b951b01432..0c30ebabc3 100644
--- a/apps/plugins/battery_bench.c
+++ b/apps/plugins/battery_bench.c
@@ -216,7 +216,7 @@ struct batt_info
216 216
217#define BUF_ELEMENTS (sizeof(bat)/sizeof(struct batt_info)) 217#define BUF_ELEMENTS (sizeof(bat)/sizeof(struct batt_info))
218 218
219static struct thread_entry *thread_id; 219static unsigned int thread_id;
220static struct event_queue thread_q; 220static struct event_queue thread_q;
221static bool in_usb_mode; 221static bool in_usb_mode;
222static unsigned int buf_idx; 222static unsigned int buf_idx;
@@ -537,7 +537,7 @@ int main(void)
537 if ((thread_id = rb->create_thread(thread, thread_stack, 537 if ((thread_id = rb->create_thread(thread, thread_stack,
538 sizeof(thread_stack), 0, "Battery Benchmark" 538 sizeof(thread_stack), 0, "Battery Benchmark"
539 IF_PRIO(, PRIORITY_BACKGROUND) 539 IF_PRIO(, PRIORITY_BACKGROUND)
540 IF_COP(, CPU))) == NULL) 540 IF_COP(, CPU))) == 0)
541 { 541 {
542 rb->splash(HZ, "Cannot create thread!"); 542 rb->splash(HZ, "Cannot create thread!");
543 return PLUGIN_ERROR; 543 return PLUGIN_ERROR;