Changeset 43:01861b41db29 in finroc_plugins_scheduling


Ignore:
Timestamp:
03.06.2019 17:39:52 (5 months ago)
Author:
Max Reichardt <max.reichardt@…>
Branch:
14.08
Phase:
public
Message:

Adds GetCurrentTaskName member function to tThreadContainerThread class (to make this information available to any diagnostics outputs)

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tThreadContainerThread.cpp

    r33 r43  
    303303} 
    304304 
    305 void tThreadContainerThread::HandleWatchdogAlert() 
     305std::string tThreadContainerThread::GetCurrentTaskName() const 
    306306{ 
    307307  tPeriodicFrameworkElementTask* task = current_task; 
    308308  if (!task) 
    309309  { 
     310    return ""; 
     311  } 
     312  return task->incoming.size() > 0 ? task->incoming[0]->GetQualifiedName() : task->GetAnnotated<core::tFrameworkElement>()->GetQualifiedName(); 
     313} 
     314 
     315void tThreadContainerThread::HandleWatchdogAlert() 
     316{ 
     317  std::string stuck_name = GetCurrentTaskName(); 
     318  if (stuck_name.empty()) 
     319  { 
    310320    FINROC_LOG_PRINT(ERROR, "Got stuck without executing any task!? This should not happen."); 
    311321  } 
    312322  else 
    313323  { 
    314     std::string stuck_name = task->incoming.size() > 0 ? task->incoming[0]->GetQualifiedName() : task->GetAnnotated<core::tFrameworkElement>()->GetQualifiedName(); 
    315324    FINROC_LOG_PRINT(ERROR, "Got stuck executing task associated with '", stuck_name, "'. Please check your code for infinite loops etc.!"); 
    316325  } 
  • tThreadContainerThread.h

    r32 r43  
    108108 
    109109  /*! 
     110   * \return Returns name of task the thread is currently processing - or empty string if no task is currently processed 
     111   */ 
     112  std::string GetCurrentTaskName() const; 
     113 
     114  /*! 
    110115   * \return Shared Pointer to thread container thread 
    111116   */ 
Note: See TracChangeset for help on using the changeset viewer.