From 706b920b9938cf34af44fe1618996afe7e0c000b Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Fri, 28 Sep 2012 19:38:46 +0200 Subject: [PATCH] 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 --- firmware/kernel.c | 7 +++++++ 1 file changed, 7 insertions(+) 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(),