/* Helper function to get the node that a specific item in the list belongs to.  */
static tTbxListNode * TbxListFindListNode(tTbxList const *list, void const *item)
/* Helper function to get the node that a specific item in the list belongs to.  */
static tTbxListNode * TbxListFindListNode(tTbxList const *list, void const *item)
{
  tTbxListNode * result = NULL;
  tTbxListNode * currentListNodePtr;
  TBX_ASSERT(list != NULL);
  TBX_ASSERT(item != NULL);
  if ( (list != NULL) && (item != NULL) )
  {
    TbxCriticalSectionEnter();
    currentListNodePtr = list->firstNodePtr;
    while (currentListNodePtr != NULL)
    {
      if (currentListNodePtr->itemPtr == item)
      {
        result = currentListNodePtr;
        break;
      }
      currentListNodePtr = currentListNodePtr->nextNodePtr;
    }
    TbxCriticalSectionExit();
  }
  return result;
}