philvdm wrote on Tuesday, August 28, 2007:
I am in a situation where I have 2 pending interrupts. Each interrupt handler posts a queue msg to 2 different tasks.
The 2 second msg seems to be lost ( even though the second msg is posted to a higher priority task than the first one )
I was wondering if it is not because of line 492. What is the idea behind the comment line 490-491
Should all the tasks that received a queue msg be waken?
signed portBASE_TYPE xQueueGenericSendFromISR( xQueueHandle pxQueue, const void * const pvItemToQueue, signed portBASE_TYPE xTaskPreviouslyWoken, portBASE_TYPE xCopyPosition )
476 {
477 /* Similar to xQueueGenericSend, except we don’t block if there is no room
478 in the queue. Also we don’t directly wake a task that was blocked on a
479 queue read, instead we return a flag to say whether a context switch is
480 required or not (i.e. has a task with a higher priority than us been woken
481 by this post). */
482 if( pxQueue->uxMessagesWaiting < pxQueue->uxLength )
483 {
484 prvCopyDataToQueue( pxQueue, pvItemToQueue, xCopyPosition );
485
486 /* If the queue is locked we do not alter the event list. This will
487 be done when the queue is unlocked later. */
488 if( pxQueue->xTxLock == queueUNLOCKED )
489 {
490 /* We only want to wake one task per ISR, so check that a task has
491 not already been woken. */
492 if( !xTaskPreviouslyWoken )
493 {
494 if( !listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) )
495 {
496 if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE )
497 {
498 /* The task waiting has a higher priority so record that a
499 context switch is required. */
500 return pdTRUE;
501 }
502 }
503 }
504 }