I am trying to use a IAR version of STR75x port. In which in blocktim.c file there is a task "vPrimaryBlockTimeTestTask". Inside this task there is folowing line of code (line no 115 - 129):
xTimeWhenBlocking = xTaskGetTickCount();
/* We should unblock after xTimeToBlock having not received
anything on the queue. */
if( xQueueReceive( xTestQueue, &xData, xTimeToBlock ) != errQUEUE_EMPTY )
xErrorOccurred = pdTRUE;
/* How long were we blocked for? */
xBlockedTime = xTaskGetTickCount() - xTimeWhenBlocking;
After doing the careful observation of these lines of code, it seems the context switching is taking place due to the xQueueReeceive() function.
My queries are as follows-
1) How can context switching is allowed inside a critical region?
2) If it is allowed what we need to take care while using it?
Can anybody help to understand these points?