Changeset 55:e948ec465cb9 in finroc_plugins_scheduling


Ignore:
Timestamp:
15.09.2020 16:00:48 (2 months ago)
Author:
Max Reichardt <max.reichardt@…>
Branch:
17.03
Children:
56:b90e67b312fb, 57:3bf99d87fc8b
Phase:
public
Message:

Introduces virtual thread container management task for more accurate output of tThreadContainerThread::GetCurrentTaskName function

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tThreadContainerThread.cpp

    r53 r55  
    8383#define FINROC_PORT_BASED_SCHEDULING 
    8484 
     85class tNoTask : public rrlib::thread::tTask 
     86{ 
     87  virtual void ExecuteTask() 
     88  {} 
     89} cNO_TASK; 
     90 
    8591//---------------------------------------------------------------------- 
    8692// Implementation 
    8793//---------------------------------------------------------------------- 
     94 
     95tPeriodicFrameworkElementTask thread_container_management(nullptr, nullptr, cNO_TASK); 
    8896 
    8997tThreadContainerThread* tThreadContainerThread::single_thread_container = nullptr; 
     
    128136                     max_execution_duration(0), 
    129137                     execution_count(0), 
    130                      current_task(NULL), 
     138                     current_task(nullptr), 
    131139                     current_cycle_start_application_time(rrlib::time::cNO_TIME) 
    132140{ 
     
    316324  } 
    317325  std::stringstream stream; 
    318   stream << *(task->incoming.size() > 0 ? task->incoming[0] : task->GetAnnotated<core::tFrameworkElement>()); 
     326  if (task == &thread_container_management) 
     327  { 
     328    stream << thread_container_element << " (Thread container management)"; 
     329  } 
     330  else 
     331  { 
     332    stream << *(task->incoming.size() > 0 ? task->incoming[0] : task->GetAnnotated<core::tFrameworkElement>()); 
     333  } 
    319334  return stream.str(); 
    320335} 
     
    358373void tThreadContainerThread::MainLoopCallback() 
    359374{ 
     375  current_task = &thread_container_management; 
     376 
    360377  if (reschedule) 
    361378  { 
     
    670687      task_profile.task_classification = tTaskClassification::OTHER; 
    671688    } 
     689    current_task = &thread_container_management; 
    672690 
    673691    // Set classification 
     
    710728 
    711729  tWatchDogTask::Deactivate(); 
     730  current_task = &thread_container_management; 
    712731 
    713732  if (thread_container_base.execution_mode == tExecutionMode::EVENT_TRIGGERED) 
  • tThreadContainerThread.h

    r46 r55  
    156156  /*! 
    157157   * Thread sets this to the task it is currently executing (for error message, should it get stuck) 
    158    * NULL if not executing any task 
     158   * nullptr if not executing any task 
    159159   */ 
    160160  tPeriodicFrameworkElementTask* current_task; 
Note: See TracChangeset for help on using the changeset viewer.