I was looking at the GateMutexPri module, thinking about how I might add timeout behaviors to it - or alternatively add priority inheritance to a semaphore based approach. While there, I found the function GateMutexPri_insertPri. It really looks like It isn't correctly finding the task handle in a Task_PendElem. Instead, it seems like it is casting a Queue_Elem pointer to be a task handle. Am I nuts? Or is there a problem here? (See gates/GateMutexPri.c, down at the bottom of the file.)
GateMutexPri_insertPri() is an internal function used to insert a Task object into a queue, in the proper order based upon the Task’s priority. The first element of at Task object is a Queue_Elem, which allows the object to be queued. So, the “(Task_Handle)qelem))” may look strange, but it is what is intended.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.