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:
parent
40ff47c7ee
commit
8cfbd3604f
32 changed files with 329 additions and 234 deletions
|
@ -78,7 +78,7 @@ static int usb_mmc_countdown = 0;
|
|||
#ifdef USB_FULL_INIT
|
||||
static long usb_stack[(DEFAULT_STACK_SIZE + 0x800)/sizeof(long)];
|
||||
static const char usb_thread_name[] = "usb";
|
||||
static struct thread_entry *usb_thread_entry;
|
||||
static unsigned int usb_thread_entry = 0;
|
||||
#endif
|
||||
static struct event_queue usb_queue;
|
||||
static int last_usb_status;
|
||||
|
@ -539,10 +539,10 @@ void usb_start_monitoring(void)
|
|||
#ifdef USB_DRIVER_CLOSE
|
||||
void usb_close(void)
|
||||
{
|
||||
struct thread_entry *thread = usb_thread_entry;
|
||||
usb_thread_entry = NULL;
|
||||
uintptr_t thread = usb_thread_entry;
|
||||
usb_thread_entry = 0;
|
||||
|
||||
if (thread == NULL)
|
||||
if (thread == 0)
|
||||
return;
|
||||
|
||||
tick_remove_task(usb_tick);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue