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
This commit is contained in:
Thomas Martitz 2012-09-28 19:38:46 +02:00
parent 082cd01eb2
commit 706b920b99

View file

@ -579,6 +579,13 @@ void queue_wait_w_tmo(struct event_queue *q, struct queue_event *ev, int ticks)
int oldlevel; int oldlevel;
unsigned int rd, wr; 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 #ifdef HAVE_EXTENDED_MESSAGING_AND_NAME
KERNEL_ASSERT(QUEUE_GET_THREAD(q) == NULL || KERNEL_ASSERT(QUEUE_GET_THREAD(q) == NULL ||
QUEUE_GET_THREAD(q) == thread_self_entry(), QUEUE_GET_THREAD(q) == thread_self_entry(),