mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-11 06:02:37 -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
|
|
@ -32,8 +32,10 @@ int set_irq_level (int level)
|
|||
return (_lv = level);
|
||||
}
|
||||
|
||||
void queue_init(struct event_queue *q)
|
||||
void queue_init(struct event_queue *q, bool register_queue)
|
||||
{
|
||||
(void)register_queue;
|
||||
|
||||
q->read = 0;
|
||||
q->write = 0;
|
||||
}
|
||||
|
|
@ -47,7 +49,7 @@ void queue_wait(struct event_queue *q, struct event *ev)
|
|||
{
|
||||
while(q->read == q->write)
|
||||
{
|
||||
switch_thread();
|
||||
switch_thread(true, NULL);
|
||||
}
|
||||
|
||||
*ev = q->events[(q->read++) & QUEUE_LENGTH_MASK];
|
||||
|
|
@ -97,8 +99,11 @@ void queue_clear(struct event_queue* q)
|
|||
q->write = 0;
|
||||
}
|
||||
|
||||
void switch_thread (void)
|
||||
void switch_thread(bool save_context, struct thread_entry **blocked_list)
|
||||
{
|
||||
(void)save_context;
|
||||
(void)blocked_list;
|
||||
|
||||
yield ();
|
||||
}
|
||||
|
||||
|
|
@ -160,7 +165,7 @@ void mutex_init(struct mutex *m)
|
|||
void mutex_lock(struct mutex *m)
|
||||
{
|
||||
while(m->locked)
|
||||
switch_thread();
|
||||
switch_thread(true, NULL);
|
||||
m->locked = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue