diff options
author | Brandon Low <lostlogic@rockbox.org> | 2006-11-11 05:33:24 +0000 |
---|---|---|
committer | Brandon Low <lostlogic@rockbox.org> | 2006-11-11 05:33:24 +0000 |
commit | 8a82892e52127f50efaafaeda3ae841e8bbefe2d (patch) | |
tree | 1dfa1a18c05018045db4fe8e67d1dc3fbc5a2d72 /firmware/kernel.c | |
parent | 806d8f3505ef7e477f9af4d1b07fe30cd1f28fb3 (diff) | |
download | rockbox-8a82892e52127f50efaafaeda3ae841e8bbefe2d.tar.gz rockbox-8a82892e52127f50efaafaeda3ae841e8bbefe2d.zip |
Thread API enhancements.
1) block_thread -> block_thread + block_thread_w_tmo -- this call was always used in distinct ways so having one call with a conditional was ugly.
2) enhance Slasheri's scheduler controlled boost concept. now any thread may trigger a boost which will last until that thread next sleeps.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11509 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/kernel.c')
-rw-r--r-- | firmware/kernel.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/firmware/kernel.c b/firmware/kernel.c index 959122ea0a..79f26f58f2 100644 --- a/firmware/kernel.c +++ b/firmware/kernel.c | |||
@@ -132,7 +132,7 @@ void queue_wait(struct event_queue *q, struct event *ev) | |||
132 | { | 132 | { |
133 | if (q->read == q->write) | 133 | if (q->read == q->write) |
134 | { | 134 | { |
135 | block_thread(&q->thread, 0); | 135 | block_thread(&q->thread); |
136 | } | 136 | } |
137 | 137 | ||
138 | *ev = q->events[(q->read++) & QUEUE_LENGTH_MASK]; | 138 | *ev = q->events[(q->read++) & QUEUE_LENGTH_MASK]; |
@@ -142,7 +142,7 @@ void queue_wait_w_tmo(struct event_queue *q, struct event *ev, int ticks) | |||
142 | { | 142 | { |
143 | if (q->read == q->write && ticks > 0) | 143 | if (q->read == q->write && ticks > 0) |
144 | { | 144 | { |
145 | block_thread(&q->thread, ticks); | 145 | block_thread_w_tmo(&q->thread, ticks); |
146 | } | 146 | } |
147 | 147 | ||
148 | if (q->read != q->write) | 148 | if (q->read != q->write) |
@@ -469,7 +469,7 @@ void mutex_lock(struct mutex *m) | |||
469 | if (m->locked) | 469 | if (m->locked) |
470 | { | 470 | { |
471 | /* Wait until the lock is open... */ | 471 | /* Wait until the lock is open... */ |
472 | block_thread(&m->thread, 0); | 472 | block_thread(&m->thread); |
473 | } | 473 | } |
474 | 474 | ||
475 | /* ...and lock it */ | 475 | /* ...and lock it */ |