Continue work on the new timer implementation. Nearly complete.

This commit is contained in:
Richard Barry 2011-02-14 10:51:18 +00:00
parent 07a2021676
commit b4ff4820cb
5 changed files with 211 additions and 155 deletions

View file

@ -1469,20 +1469,27 @@ signed portBASE_TYPE xReturn;
void vQueueWaitForMessageRestricted( xQueueHandle pxQueue, portTickType xTicksToWait )
{
/* This function should not be called by application code hence the
'Restricted' in its name. It is not part of the public API. It is designed
for use by kernel code, and has special calling requirements - it should be
called from a critical section, and then a yield performed after it is
called. Also, the call tree makes use of vListInsert() which should normally
not be called from a critical section - so an assumption is made that the list
being inserted into is empty and therefore the insertion will be fast. */
/* This function should not be called by application code hence the
'Restricted' in its name. It is not part of the public API. It is
designed for use by kernel code, and has special calling requirements.
It can result in vListInsert() being called on a list that can only
possibly ever have one item in it, so the list will be fast, but even
so it should be called with the scheduler locked and not from a critical
section. */
/* Only do anything if there are no message in the queue. */
/* Only do anything if there are no messages in the queue. This function
will not actually cause the task to block, just place it on a blocked
list. It will not block until the scheduler is unlocked - at which
time a yield will be performed. If an item is added to the queue while
the queue is locked, and the calling task blocks on the queue, then the
calling task will be immediately unblocked when the queue is unlocked. */
prvLockQueue( pxQueue );
if( pxQueue->uxMessagesWaiting == ( unsigned portBASE_TYPE ) 0U )
{
/* There is nothing in the queue, block for the specified period. */
vTaskPlaceOnEventListRestricted( &( pxQueue->xTasksWaitingToReceive ), xTicksToWait );
}
prvUnlockQueue( pxQueue );
}
#endif