dansear wrote on Friday, July 27, 2007:
In 4.3.1:
Small issue in xQueueSend() and xQueueReceive() in queue.c.
Near the end, where it has the code:
if( xTicksToWait > 0 )
{
if( xTaskCheckForTimeOut( &xTimeOut, &xTicksToWait ) == pdFALSE )
{
xReturn = queueERRONEOUS_UNBLOCK;
}
}
I recommend:
#if ( INCLUDE_vTaskSuspend == 1 )
if(( xTicksToWait > 0 ) && ( xTicksToWait != portMAX_DELAY ))
#else
if( xTicksToWait > 0 )
#endif
{
if( xTaskCheckForTimeOut( &xTimeOut, &xTicksToWait ) == pdFALSE )
{
xReturn = queueERRONEOUS_UNBLOCK;
}
}
xTicksToWait is set portMAX_DELAY for indefinite waits, but without
the above change, it will be decremented. This slightly effects
later code, which processes threads differently depending on if
their wait time is portMAX_DELAY or not.
Dan Searles