Actions
バグ #3658
closedExecutionContextWorker::removeComponent関数で動作が停止する問題
Start date:
10/11/2016
Due date:
% Done:
100%
Estimated time:
Description
ExecutionContextWorker::removeComponent関数の以下の部分でミューテックスm_removedMutexでロックをするが、このロックを解放せずにupdateComponentList関数で再度ロックしようとするため身動きがとれなくなることがある。
Guard removeGuard(m_removedMutex);
m_removedComps.push_back(rtobj);
Guard guard(m_mutex);
if (!m_running) { updateComponentList(); }
Updated by n-ando about 9 years ago
- Assignee set to miyamoto
- Target version set to RELENG_1_2
- % Done changed from 0 to 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;
}
再テストおねがいします。>宮本君
Updated by n-miyamoto about 9 years ago
- Status changed from 新規 to 解決
- % Done changed from 90 to 100
PeriodicExecutionContextTestsのtest_removeComponent関数で正常に動作することを確認
Actions