summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2012-09-28 19:38:46 +0200
committerThomas Martitz <kugel@rockbox.org>2012-09-28 19:40:17 +0200
commit706b920b9938cf34af44fe1618996afe7e0c000b (patch)
tree910e623f3ac09e15f85f0c51915b19da63b989c2 /firmware
parent082cd01eb212e9d973f64b3e90ed8e3345026ac5 (diff)
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')
-rw-r--r--firmware/kernel.c7
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)
int oldlevel;
unsigned int rd, wr;
+ /* this function works only with a positive number (or zero) of ticks */
+ if (ticks == TIMEOUT_BLOCK)
+ {
+ queue_wait(q, ev);
+ return;
+ }
+
#ifdef HAVE_EXTENDED_MESSAGING_AND_NAME
KERNEL_ASSERT(QUEUE_GET_THREAD(q) == NULL ||
QUEUE_GET_THREAD(q) == thread_self_entry(),