1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Michael Sevakis 2008-12-10 08:57:10 +00:00
parent 40ff47c7ee
commit 8cfbd3604f
32 changed files with 329 additions and 234 deletions

View file

@ -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;
}
}