diff options
author | Thomas Martitz <kugel@rockbox.org> | 2012-09-28 19:38:46 +0200 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2012-09-28 19:40:17 +0200 |
commit | 706b920b9938cf34af44fe1618996afe7e0c000b (patch) | |
tree | 910e623f3ac09e15f85f0c51915b19da63b989c2 /firmware/kernel.c | |
parent | 082cd01eb212e9d973f64b3e90ed8e3345026ac5 (diff) | |
download | rockbox-706b920b9938cf34af44fe1618996afe7e0c000b.tar.gz rockbox-706b920b9938cf34af44fe1618996afe7e0c000b.zip |
kernel: Allow queue_wait_w_tmo() to be called with TIMEOUT_BLOCK.
Previously TIMEOUT_BLOCK would be handled the same as TIMEOUT_NOBLOCK, i.e.
poll only without thread switch, which is rather unexpected from *_w_tmo()
functions. No current code doesn't call it that way yet.
Change-Id: I370ce0f752681122d197eadeee9ab17112647c20
Diffstat (limited to 'firmware/kernel.c')
-rw-r--r-- | firmware/kernel.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/firmware/kernel.c b/firmware/kernel.c index 0b39e29126..a264ceb9e4 100644 --- a/firmware/kernel.c +++ b/firmware/kernel.c | |||
@@ -579,6 +579,13 @@ void queue_wait_w_tmo(struct event_queue *q, struct queue_event *ev, int ticks) | |||
579 | int oldlevel; | 579 | int oldlevel; |
580 | unsigned int rd, wr; | 580 | unsigned int rd, wr; |
581 | 581 | ||
582 | /* this function works only with a positive number (or zero) of ticks */ | ||
583 | if (ticks == TIMEOUT_BLOCK) | ||
584 | { | ||
585 | queue_wait(q, ev); | ||
586 | return; | ||
587 | } | ||
588 | |||
582 | #ifdef HAVE_EXTENDED_MESSAGING_AND_NAME | 589 | #ifdef HAVE_EXTENDED_MESSAGING_AND_NAME |
583 | KERNEL_ASSERT(QUEUE_GET_THREAD(q) == NULL || | 590 | KERNEL_ASSERT(QUEUE_GET_THREAD(q) == NULL || |
584 | QUEUE_GET_THREAD(q) == thread_self_entry(), | 591 | QUEUE_GET_THREAD(q) == thread_self_entry(), |