mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-18 01:22:38 -05:00
New scheduler, with priorities for swcodec platforms. Frequent task
switching should be more efficient and tasks are stored in linked lists to eliminate unnecessary task switching to improve performance. Audio should no longer skip on swcodec targets caused by too CPU hungry UI thread or background threads. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10958 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
baf5494341
commit
a85044bf9e
36 changed files with 834 additions and 413 deletions
|
|
@ -202,7 +202,7 @@ struct
|
|||
/* communication to the worker thread */
|
||||
struct
|
||||
{
|
||||
int id; /* ID of the thread */
|
||||
struct thread_entry *id; /* Pointer of the thread */
|
||||
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 */
|
||||
|
|
@ -1169,7 +1169,8 @@ int main(void* parameter)
|
|||
|
||||
rb->memset(&gTread, 0, sizeof(gTread));
|
||||
gTread.foreground = true;
|
||||
gTread.id = rb->create_thread(thread, stack, stacksize, "CDC");
|
||||
gTread.id = rb->create_thread(thread, stack, stacksize, "CDC"
|
||||
IF_PRIO(, PRIORITY_BACKGROUND));
|
||||
|
||||
#ifdef DEBUG
|
||||
do
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
|||
|
||||
struct
|
||||
{
|
||||
int id;
|
||||
struct thread_entry *id;
|
||||
bool ended;
|
||||
} s_thread;
|
||||
|
||||
|
|
@ -454,10 +454,11 @@ int main(void)
|
|||
rb->close(fd);
|
||||
}
|
||||
|
||||
rb->queue_init(&thread_q); /* put the thread's queue in the bcast list */
|
||||
rb->queue_init(&thread_q, true); /* put the thread's queue in the bcast list */
|
||||
rb->memset(&s_thread, 0, sizeof(s_thread)); /* zero the struct */
|
||||
if((s_thread.id = rb->create_thread(thread, thread_stack,
|
||||
sizeof(thread_stack), "Battery Benchmark"))<0)
|
||||
sizeof(thread_stack), "Battery Benchmark"
|
||||
IF_PRIO(, PRIORITY_BACKGROUND))) == NULL)
|
||||
{
|
||||
rb->splash(HZ,true,"Cannot create thread!");
|
||||
return PLUGIN_ERROR;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue