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/plugins/mpegplayer/disk_buf.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/plugins/mpegplayer/disk_buf.c')
-rw-r--r-- | apps/plugins/mpegplayer/disk_buf.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/plugins/mpegplayer/disk_buf.c b/apps/plugins/mpegplayer/disk_buf.c index df5e005b50..c008139356 100644 --- a/apps/plugins/mpegplayer/disk_buf.c +++ b/apps/plugins/mpegplayer/disk_buf.c | |||
@@ -835,7 +835,7 @@ void disk_buf_reply_msg(intptr_t retval) | |||
835 | 835 | ||
836 | bool disk_buf_init(void) | 836 | bool disk_buf_init(void) |
837 | { | 837 | { |
838 | disk_buf.thread = NULL; | 838 | disk_buf.thread = 0; |
839 | list_initialize(&nf_list); | 839 | list_initialize(&nf_list); |
840 | 840 | ||
841 | rb->mutex_init(&disk_buf_mtx); | 841 | rb->mutex_init(&disk_buf_mtx); |
@@ -893,7 +893,7 @@ bool disk_buf_init(void) | |||
893 | rb->queue_enable_queue_send(disk_buf.q, &disk_buf_queue_send, | 893 | rb->queue_enable_queue_send(disk_buf.q, &disk_buf_queue_send, |
894 | disk_buf.thread); | 894 | disk_buf.thread); |
895 | 895 | ||
896 | if (disk_buf.thread == NULL) | 896 | if (disk_buf.thread == 0) |
897 | return false; | 897 | return false; |
898 | 898 | ||
899 | /* Wait for thread to initialize */ | 899 | /* Wait for thread to initialize */ |
@@ -904,10 +904,10 @@ bool disk_buf_init(void) | |||
904 | 904 | ||
905 | void disk_buf_exit(void) | 905 | void disk_buf_exit(void) |
906 | { | 906 | { |
907 | if (disk_buf.thread != NULL) | 907 | if (disk_buf.thread != 0) |
908 | { | 908 | { |
909 | rb->queue_post(disk_buf.q, STREAM_QUIT, 0); | 909 | rb->queue_post(disk_buf.q, STREAM_QUIT, 0); |
910 | rb->thread_wait(disk_buf.thread); | 910 | rb->thread_wait(disk_buf.thread); |
911 | disk_buf.thread = NULL; | 911 | disk_buf.thread = 0; |
912 | } | 912 | } |
913 | } | 913 | } |