Add a cap to the queue locks (#435)
Add a cap to the queue locks cRxLock and cTxLock members of the queue data structure count the number items received and sent to the queue while the queue was locked. These are later used to unblock tasks waiting on the queue when the queue is unlocked. The data type of these members is int8_t and this can trigger overflow check assert if an ISR continuously reads/writes to the queue in a loop as reported in this issue: https://github.com/FreeRTOS/FreeRTOS-Kernel/issues/419. Note due to the length of the operation is it not recommended to write to the queue that many times from an ISR - stream buffers are a better option, or alternatively, defer the operation to a task by just having the ISR send a direct to task notification to unblock the task. This PR caps the values of the cRxLock and cTxLock to the number of tasks in the system because we cannot unblocks more tasks than there are in the system. Note that the same assert could still be triggered is the application creates more than 127 tasks. Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>pull/436/head^2
parent
8e2dd5b861
commit
becbb89181
Loading…
Reference in New Issue