MCPcopy Create free account
hub / github.com/FreeRTOS/FreeRTOS-Kernel / prvNotifyQueueSetContainer

Function prvNotifyQueueSetContainer

queue.c:2974–3028  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2972#if ( configUSE_QUEUE_SETS == 1 )
2973
2974 static BaseType_t prvNotifyQueueSetContainer( const Queue_t * const pxQueue )
2975 {
2976 Queue_t * pxQueueSetContainer = pxQueue->pxQueueSetContainer;
2977 BaseType_t xReturn = pdFALSE;
2978
2979 /* This function must be called form a critical section. */
2980
2981 /* The following line is not reachable in unit tests because every call
2982 * to prvNotifyQueueSetContainer is preceded by a check that
2983 * pxQueueSetContainer != NULL */
2984 configASSERT( pxQueueSetContainer ); /* LCOV_EXCL_BR_LINE */
2985 configASSERT( pxQueueSetContainer->uxMessagesWaiting < pxQueueSetContainer->uxLength );
2986
2987 if( pxQueueSetContainer->uxMessagesWaiting < pxQueueSetContainer->uxLength )
2988 {
2989 const int8_t cTxLock = pxQueueSetContainer->cTxLock;
2990
2991 traceQUEUE_SET_SEND( pxQueueSetContainer );
2992
2993 /* The data copied is the handle of the queue that contains data. */
2994 xReturn = prvCopyDataToQueue( pxQueueSetContainer, &pxQueue, queueSEND_TO_BACK );
2995
2996 if( cTxLock == queueUNLOCKED )
2997 {
2998 if( listLIST_IS_EMPTY( &( pxQueueSetContainer->xTasksWaitingToReceive ) ) == pdFALSE )
2999 {
3000 if( xTaskRemoveFromEventList( &( pxQueueSetContainer->xTasksWaitingToReceive ) ) != pdFALSE )
3001 {
3002 /* The task waiting has a higher priority. */
3003 xReturn = pdTRUE;
3004 }
3005 else
3006 {
3007 mtCOVERAGE_TEST_MARKER();
3008 }
3009 }
3010 else
3011 {
3012 mtCOVERAGE_TEST_MARKER();
3013 }
3014 }
3015 else
3016 {
3017 configASSERT( cTxLock != queueINT8_MAX );
3018
3019 pxQueueSetContainer->cTxLock = ( int8_t ) ( cTxLock + 1 );
3020 }
3021 }
3022 else
3023 {
3024 mtCOVERAGE_TEST_MARKER();
3025 }
3026
3027 return xReturn;
3028 }
3029
3030#endif /* configUSE_QUEUE_SETS */

Callers 4

xQueueGenericSendFunction · 0.85
xQueueGenericSendFromISRFunction · 0.85
xQueueGiveFromISRFunction · 0.85
prvUnlockQueueFunction · 0.85

Calls 2

prvCopyDataToQueueFunction · 0.85
xTaskRemoveFromEventListFunction · 0.85

Tested by

no test coverage detected