操作
バグ #3658
完了ExecutionContextWorker::removeComponent関数で動作が停止する問題
開始日:
2016/10/11
期日:
進捗率:
100%
予定工数:
説明
ExecutionContextWorker::removeComponent関数の以下の部分でミューテックスm_removedMutexでロックをするが、このロックを解放せずにupdateComponentList関数で再度ロックしようとするため身動きがとれなくなることがある。
Guard removeGuard(m_removedMutex);
 m_removedComps.push_back(rtobj);
Guard guard(m_mutex);
if (!m_running) { updateComponentList(); }
  n-ando さんが約9年前に更新
- 担当者 を miyamoto にセット
- 対象バージョン を RELENG_1_2 にセット
- 進捗率 を 0 から 90 に変更
mutexロックにスコープを追加
===================================================================
--- ExecutionContextWorker.cpp  (リビジョン 2778)
+++ ExecutionContextWorker.cpp  (作業コピー)
@@ -143,7 +143,7 @@
    * @brief Changing execution rate of the ExecutionContext
    * @endif
    */
-  RTC::ReturnCode_t ExecutionContextWorker::rateChanged(void)
+  RTC::ReturnCode_t ExecutionContextWorker::rateChanged()
   {
     RTC_TRACE(("rateChanged()"));
     // invoke on_shutdown for each comps.
@@ -367,12 +367,15 @@
         RTC_ERROR(("no RTC found in this context."));
         return  RTC::BAD_PARAMETER;
       }
-    Guard removeGuard(m_removedMutex);
-    m_removedComps.push_back(rtobj);
-
+    {
+      Guard removeGuard(m_removedMutex);
+      m_removedComps.push_back(rtobj);
+    }
     // if EC is stopping, update component list immediately.
-    Guard guard(m_mutex);
-    if (!m_running) { updateComponentList(); }
+    {
+      Guard guard(m_mutex);
+      if (!m_running) { updateComponentList(); }
+    }
     return RTC::RTC_OK;
   }
	再テストおねがいします。>宮本君
n-miyamoto さんがほぼ9年前に更新
- ステータス を 新規 から 解決 に変更
- 進捗率 を 90 から 100 に変更
PeriodicExecutionContextTestsのtest_removeComponent関数で正常に動作することを確認
操作