1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Brandon Low 2006-11-11 05:33:24 +00:00
parent 806d8f3505
commit 8a82892e52
5 changed files with 146 additions and 110 deletions

View file

@ -132,7 +132,7 @@ void queue_wait(struct event_queue *q, struct event *ev)
{
if (q->read == q->write)
{
block_thread(&q->thread, 0);
block_thread(&q->thread);
}
*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)
{
if (q->read == q->write && ticks > 0)
{
block_thread(&q->thread, ticks);
block_thread_w_tmo(&q->thread, ticks);
}
if (q->read != q->write)
@ -469,7 +469,7 @@ void mutex_lock(struct mutex *m)
if (m->locked)
{
/* Wait until the lock is open... */
block_thread(&m->thread, 0);
block_thread(&m->thread);
}
/* ...and lock it */