diff options
author | Miika Pekkarinen <miipekk@ihme.org> | 2006-09-16 16:18:11 +0000 |
---|---|---|
committer | Miika Pekkarinen <miipekk@ihme.org> | 2006-09-16 16:18:11 +0000 |
commit | a85044bf9eaa0a7206c1978d3cfd57ab2d7fae2f (patch) | |
tree | a30695ed540bf32365d577f46398f712c7a494c4 /uisimulator/sdl/kernel.c | |
parent | baf5494341cdd6cdb9590e21d429920b9bc4a2c6 (diff) | |
download | rockbox-a85044bf9eaa0a7206c1978d3cfd57ab2d7fae2f.tar.gz 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/sdl/kernel.c')
-rw-r--r-- | uisimulator/sdl/kernel.c | 13 |
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) | |||
32 | return (_lv = level); | 32 | return (_lv = level); |
33 | } | 33 | } |
34 | 34 | ||
35 | void queue_init(struct event_queue *q) | 35 | void queue_init(struct event_queue *q, bool register_queue) |
36 | { | 36 | { |
37 | (void)register_queue; | ||
38 | |||
37 | q->read = 0; | 39 | q->read = 0; |
38 | q->write = 0; | 40 | q->write = 0; |
39 | } | 41 | } |
@@ -47,7 +49,7 @@ void queue_wait(struct event_queue *q, struct event *ev) | |||
47 | { | 49 | { |
48 | while(q->read == q->write) | 50 | while(q->read == q->write) |
49 | { | 51 | { |
50 | switch_thread(); | 52 | switch_thread(true, NULL); |
51 | } | 53 | } |
52 | 54 | ||
53 | *ev = q->events[(q->read++) & QUEUE_LENGTH_MASK]; | 55 | *ev = q->events[(q->read++) & QUEUE_LENGTH_MASK]; |
@@ -97,8 +99,11 @@ void queue_clear(struct event_queue* q) | |||
97 | q->write = 0; | 99 | q->write = 0; |
98 | } | 100 | } |
99 | 101 | ||
100 | void switch_thread (void) | 102 | void switch_thread(bool save_context, struct thread_entry **blocked_list) |
101 | { | 103 | { |
104 | (void)save_context; | ||
105 | (void)blocked_list; | ||
106 | |||
102 | yield (); | 107 | yield (); |
103 | } | 108 | } |
104 | 109 | ||
@@ -160,7 +165,7 @@ void mutex_init(struct mutex *m) | |||
160 | void mutex_lock(struct mutex *m) | 165 | void mutex_lock(struct mutex *m) |
161 | { | 166 | { |
162 | while(m->locked) | 167 | while(m->locked) |
163 | switch_thread(); | 168 | switch_thread(true, NULL); |
164 | m->locked = true; | 169 | m->locked = true; |
165 | } | 170 | } |
166 | 171 | ||