summaryrefslogtreecommitdiffstats
path: root/uisimulator
diff options
context:
space:
mode:
authorMiika Pekkarinen <miipekk@ihme.org>2006-09-16 16:18:11 +0000
committerMiika Pekkarinen <miipekk@ihme.org>2006-09-16 16:18:11 +0000
commita85044bf9eaa0a7206c1978d3cfd57ab2d7fae2f (patch)
treea30695ed540bf32365d577f46398f712c7a494c4 /uisimulator
parentbaf5494341cdd6cdb9590e21d429920b9bc4a2c6 (diff)
downloadrockbox-a85044bf9eaa0a7206c1978d3cfd57ab2d7fae2f.tar.gz
rockbox-a85044bf9eaa0a7206c1978d3cfd57ab2d7fae2f.tar.bz2
rockbox-a85044bf9eaa0a7206c1978d3cfd57ab2d7fae2f.zip
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
Diffstat (limited to 'uisimulator')
-rw-r--r--uisimulator/sdl/kernel.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/uisimulator/sdl/kernel.c b/uisimulator/sdl/kernel.c
index b9ffe0eefe..bfe6062450 100644
--- a/uisimulator/sdl/kernel.c
+++ b/uisimulator/sdl/kernel.c
@@ -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;
}