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 /firmware/backlight.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 'firmware/backlight.c')
-rw-r--r-- | firmware/backlight.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/firmware/backlight.c b/firmware/backlight.c index 07cc9532be..66cc6df569 100644 --- a/firmware/backlight.c +++ b/firmware/backlight.c | |||
@@ -130,7 +130,7 @@ static long backlight_stack[DEFAULT_STACK_SIZE/sizeof(long)]; | |||
130 | static const char backlight_thread_name[] = "backlight"; | 130 | static const char backlight_thread_name[] = "backlight"; |
131 | static struct event_queue backlight_queue; | 131 | static struct event_queue backlight_queue; |
132 | #ifdef BACKLIGHT_DRIVER_CLOSE | 132 | #ifdef BACKLIGHT_DRIVER_CLOSE |
133 | static struct thread_entry *backlight_thread_p = NULL; | 133 | static unsigned int backlight_thread_id = 0; |
134 | #endif | 134 | #endif |
135 | 135 | ||
136 | static int backlight_timer SHAREDBSS_ATTR; | 136 | static int backlight_timer SHAREDBSS_ATTR; |
@@ -744,7 +744,7 @@ void backlight_init(void) | |||
744 | * call the appropriate backlight_set_*() functions, only changing light | 744 | * call the appropriate backlight_set_*() functions, only changing light |
745 | * status if necessary. */ | 745 | * status if necessary. */ |
746 | #ifdef BACKLIGHT_DRIVER_CLOSE | 746 | #ifdef BACKLIGHT_DRIVER_CLOSE |
747 | backlight_thread_p = | 747 | backlight_thread_id = |
748 | #endif | 748 | #endif |
749 | create_thread(backlight_thread, backlight_stack, | 749 | create_thread(backlight_thread, backlight_stack, |
750 | sizeof(backlight_stack), 0, backlight_thread_name | 750 | sizeof(backlight_stack), 0, backlight_thread_name |
@@ -756,13 +756,13 @@ void backlight_init(void) | |||
756 | #ifdef BACKLIGHT_DRIVER_CLOSE | 756 | #ifdef BACKLIGHT_DRIVER_CLOSE |
757 | void backlight_close(void) | 757 | void backlight_close(void) |
758 | { | 758 | { |
759 | struct thread_entry *thread = backlight_thread_p; | 759 | unsigned int thread = backlight_thread_id; |
760 | 760 | ||
761 | /* Wait for thread to exit */ | 761 | /* Wait for thread to exit */ |
762 | if (thread == NULL) | 762 | if (thread == 0) |
763 | return; | 763 | return; |
764 | 764 | ||
765 | backlight_thread_p = NULL; | 765 | backlight_thread_id = 0; |
766 | 766 | ||
767 | queue_post(&backlight_queue, BACKLIGHT_QUIT, 0); | 767 | queue_post(&backlight_queue, BACKLIGHT_QUIT, 0); |
768 | thread_wait(thread); | 768 | thread_wait(thread); |