From 8cfbd3604fac14f629244e521ad24ffa9938c790 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Wed, 10 Dec 2008 08:57:10 +0000 Subject: 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 --- apps/plugins/mpegplayer/disk_buf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'apps/plugins/mpegplayer/disk_buf.c') 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) bool disk_buf_init(void) { - disk_buf.thread = NULL; + disk_buf.thread = 0; list_initialize(&nf_list); rb->mutex_init(&disk_buf_mtx); @@ -893,7 +893,7 @@ bool disk_buf_init(void) rb->queue_enable_queue_send(disk_buf.q, &disk_buf_queue_send, disk_buf.thread); - if (disk_buf.thread == NULL) + if (disk_buf.thread == 0) return false; /* Wait for thread to initialize */ @@ -904,10 +904,10 @@ bool disk_buf_init(void) void disk_buf_exit(void) { - if (disk_buf.thread != NULL) + if (disk_buf.thread != 0) { rb->queue_post(disk_buf.q, STREAM_QUIT, 0); rb->thread_wait(disk_buf.thread); - disk_buf.thread = NULL; + disk_buf.thread = 0; } } -- cgit v1.2.3