[openrtm-commit:02091] r2795 - trunk/OpenRTM-aist/src/lib/rtm

openrtm @ openrtm.org openrtm @ openrtm.org
2016年 11月 1日 (火) 02:13:51 JST


Author: n-ando
Date: 2016-11-01 02:13:51 +0900 (Tue, 01 Nov 2016)
New Revision: 2795

Modified:
   trunk/OpenRTM-aist/src/lib/rtm/ExecutionContextWorker.h
   trunk/OpenRTM-aist/src/lib/rtm/PeriodicExecutionContext.cpp
   trunk/OpenRTM-aist/src/lib/rtm/PeriodicExecutionContext.h
Log:
[incompat,bugfix,EC] EC activation bug for multiple RTCs when they activated from participants RTCs. refs #3697

Modified: trunk/OpenRTM-aist/src/lib/rtm/ExecutionContextWorker.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/ExecutionContextWorker.h	2016-10-28 08:40:37 UTC (rev 2794)
+++ trunk/OpenRTM-aist/src/lib/rtm/ExecutionContextWorker.h	2016-10-31 17:13:51 UTC (rev 2795)
@@ -249,6 +249,11 @@
      */
     RTC::ReturnCode_t stop(void);
 
+    RTC::ReturnCode_t startThread(void);
+
+    RTC::ReturnCode_t stopThread(void);
+
+    
     /*!
      * @if jp
      * @brief ExecutionContext の実行周期が変更された
@@ -544,9 +549,7 @@
     void invokeWorkerPreDo();
     void invokeWorkerDo();
     void invokeWorkerPostDo();
-    
-    
-  protected:
+
     /*!
      * @if jp
      * @brief コンポーネントリストの更新
@@ -556,26 +559,6 @@
      */
     void updateComponentList();
 
-
-
-    /*!
-     * @if jp
-     * @brief コンポーネント検索用ファンクタ
-     * @else
-     * @brief Functor to find the component
-     * @endif
-     */
-//    struct find_comp
-//    {
-//      RTC::LightweightRTObject_var m_comp;
-//      find_comp(RTC::LightweightRTObject_ptr comp)
-//        : m_comp(RTC::LightweightRTObject::_duplicate(comp)) {}
-//      bool operator()(RTObjectStateMachine* comp)
-//      {
-//        return comp->isEquivalent(m_comp);
-//      }
-//    };
-
     //------------------------------------------------------------
     // member variables
   protected:

Modified: trunk/OpenRTM-aist/src/lib/rtm/PeriodicExecutionContext.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/PeriodicExecutionContext.cpp	2016-10-28 08:40:37 UTC (rev 2794)
+++ trunk/OpenRTM-aist/src/lib/rtm/PeriodicExecutionContext.cpp	2016-10-31 17:13:51 UTC (rev 2795)
@@ -394,6 +394,32 @@
     m_workerthread.running_ = false;
     return RTC::RTC_OK;
   }
+  // template virtual functions adding/removing component
+  /*!
+   * @brief onAddedComponent() template function
+   */
+  RTC::ReturnCode_t PeriodicExecutionContext::
+  onAddedComponent(RTC::LightweightRTObject_ptr rtobj)
+  {
+    Guard guard(m_workerthread.mutex_);
+    if (m_workerthread.running_ == false)
+      {
+        m_worker.updateComponentList();
+      }
+  }
+  /*!
+   * @brief onRemovedComponent() template function
+   */
+  RTC::ReturnCode_t PeriodicExecutionContext::
+  onRemovedComponent(RTC::LightweightRTObject_ptr rtobj)
+  {
+    Guard guard(m_workerthread.mutex_);
+    if (m_workerthread.running_ == false)
+      {
+        m_worker.updateComponentList();
+      }
+    return RTC::RTC_OK;
+  }
 
   /*!
    * @brief onWaitingActivated() template function

Modified: trunk/OpenRTM-aist/src/lib/rtm/PeriodicExecutionContext.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/PeriodicExecutionContext.h	2016-10-28 08:40:37 UTC (rev 2794)
+++ trunk/OpenRTM-aist/src/lib/rtm/PeriodicExecutionContext.h	2016-10-31 17:13:51 UTC (rev 2795)
@@ -579,7 +579,19 @@
      * @brief onStopping() template function
      */
     virtual RTC::ReturnCode_t onStopping();
+    // template virtual functions adding/removing component
     /*!
+     * @brief onAddedComponent() template function
+     */
+     virtual RTC::ReturnCode_t
+     onAddedComponent(RTC::LightweightRTObject_ptr rtobj);
+    /*!
+     * @brief onRemovedComponent() template function
+     */
+    virtual RTC::ReturnCode_t
+    onRemovedComponent(RTC::LightweightRTObject_ptr rtobj);
+
+    /*!
      * @brief onWaitingActivated() template function
      */
     virtual RTC::ReturnCode_t



More information about the openrtm-commit mailing list