summaryrefslogtreecommitdiff
path: root/apps/plugins/alpine_cdc.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2007-10-22 05:57:38 +0000
committerMichael Sevakis <jethead71@rockbox.org>2007-10-22 05:57:38 +0000
commit7e12bba0d26a609ce16e981f0ebd4b8e73f59a8e (patch)
tree71673763db2a63da47e34f62e7513b2c8e987c87 /apps/plugins/alpine_cdc.c
parent344c41f644e9b95da55a66ea47d7b4afc6102e47 (diff)
downloadrockbox-7e12bba0d26a609ce16e981f0ebd4b8e73f59a8e.zip
rockbox-7e12bba0d26a609ce16e981f0ebd4b8e73f59a8e.tar.gz
rockbox-7e12bba0d26a609ce16e981f0ebd4b8e73f59a8e.tar.bz2
rockbox-7e12bba0d26a609ce16e981f0ebd4b8e73f59a8e.tar.xz
Phase in thread_wait when waiting for a thread to exit. Begin phasing out the spinlock object for general use; it will become a multicore-only object for core locking. Take care of plugins first.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15260 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/alpine_cdc.c')
-rw-r--r--apps/plugins/alpine_cdc.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/apps/plugins/alpine_cdc.c b/apps/plugins/alpine_cdc.c
index 6223387..919ce18 100644
--- a/apps/plugins/alpine_cdc.c
+++ b/apps/plugins/alpine_cdc.c
@@ -204,7 +204,7 @@ struct
{
bool foreground; /* set as long as we're owning the UI */
bool exiting; /* signal to the thread that we want to exit */
- bool ended; /* response from the thread, that is has exited */
+ struct thread_entry *thread; /* worker thread id */
} gTread;
static struct plugin_api* rb; /* here is the global API struct pointer */
@@ -1112,8 +1112,6 @@ void thread(void)
}
} while (!gTread.exiting);
-
- gTread.ended = true; /* acknowledge the exit */
}
/* callback to end the TSR plugin, called before a new one gets loaded */
@@ -1122,8 +1120,7 @@ bool exit_tsr(bool reenter)
if (reenter)
return false; /* dont let it start again */
gTread.exiting = true; /* tell the thread to end */
- while (!gTread.ended) /* wait until it did */
- rb->yield();
+ rb->thread_wait(gTread.thread); /* wait until it did */
uart_init(BAUDRATE); /* return to standard baudrate */
IPRE = (IPRE & ~0xF000); /* UART interrupt off */
@@ -1167,9 +1164,9 @@ int main(void* parameter)
rb->memset(&gTread, 0, sizeof(gTread));
gTread.foreground = true;
- rb->create_thread(thread, stack, stacksize, 0, "CDC"
- IF_PRIO(, PRIORITY_BACKGROUND)
- IF_COP(, CPU));
+ gTread.thread = rb->create_thread(thread, stack, stacksize, 0, "CDC"
+ IF_PRIO(, PRIORITY_BACKGROUND)
+ IF_COP(, CPU));
#ifdef DEBUG
do