mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2026-05-12 11:42:57 -04:00
Merge 5b9a8ca934 into a8c9d35152
This commit is contained in:
commit
5bd9d53062
1 changed files with 36 additions and 63 deletions
31
queue.c
31
queue.c
|
|
@ -1635,23 +1635,15 @@ BaseType_t xQueueReceive( QueueHandle_t xQueue,
|
|||
}
|
||||
else
|
||||
{
|
||||
/* Timed out. If there is no data in the queue exit, otherwise loop
|
||||
* back and attempt to read the data. */
|
||||
/* The timeout has expired. */
|
||||
prvUnlockQueue( pxQueue );
|
||||
( void ) xTaskResumeAll();
|
||||
|
||||
if( prvIsQueueEmpty( pxQueue ) != pdFALSE )
|
||||
{
|
||||
traceQUEUE_RECEIVE_FAILED( pxQueue );
|
||||
traceRETURN_xQueueReceive( errQUEUE_EMPTY );
|
||||
|
||||
return errQUEUE_EMPTY;
|
||||
}
|
||||
else
|
||||
{
|
||||
mtCOVERAGE_TEST_MARKER();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
|
@ -1829,12 +1821,6 @@ BaseType_t xQueueSemaphoreTake( QueueHandle_t xQueue,
|
|||
prvUnlockQueue( pxQueue );
|
||||
( void ) xTaskResumeAll();
|
||||
|
||||
/* If the semaphore count is 0 exit now as the timeout has
|
||||
* expired. Otherwise return to attempt to take the semaphore that is
|
||||
* known to be available. As semaphores are implemented by queues the
|
||||
* queue being empty is equivalent to the semaphore count being 0. */
|
||||
if( prvIsQueueEmpty( pxQueue ) != pdFALSE )
|
||||
{
|
||||
#if ( configUSE_MUTEXES == 1 )
|
||||
{
|
||||
/* xInheritanceOccurred could only have be set if
|
||||
|
|
@ -1872,11 +1858,6 @@ BaseType_t xQueueSemaphoreTake( QueueHandle_t xQueue,
|
|||
|
||||
return errQUEUE_EMPTY;
|
||||
}
|
||||
else
|
||||
{
|
||||
mtCOVERAGE_TEST_MARKER();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
|
@ -2015,23 +1996,15 @@ BaseType_t xQueuePeek( QueueHandle_t xQueue,
|
|||
}
|
||||
else
|
||||
{
|
||||
/* The timeout has expired. If there is still no data in the queue
|
||||
* exit, otherwise go back and try to read the data again. */
|
||||
/* The timeout has expired. */
|
||||
prvUnlockQueue( pxQueue );
|
||||
( void ) xTaskResumeAll();
|
||||
|
||||
if( prvIsQueueEmpty( pxQueue ) != pdFALSE )
|
||||
{
|
||||
traceQUEUE_PEEK_FAILED( pxQueue );
|
||||
traceRETURN_xQueuePeek( errQUEUE_EMPTY );
|
||||
|
||||
return errQUEUE_EMPTY;
|
||||
}
|
||||
else
|
||||
{
|
||||
mtCOVERAGE_TEST_MARKER();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue