[openrtm-commit:02052] r2780 - trunk/OpenRTM-aist/src/lib/rtm

openrtm @ openrtm.org openrtm @ openrtm.org
2016年 10月 13日 (木) 13:56:17 JST


Author: n-ando
Date: 2016-10-13 13:56:17 +0900 (Thu, 13 Oct 2016)
New Revision: 2780

Modified:
   trunk/OpenRTM-aist/src/lib/rtm/ExecutionContextWorker.cpp
Log:
[compat,bugfix,->RELENG_1_2] Potential deadlock mutexes are now put into limited scopes. refs #3658

Modified: trunk/OpenRTM-aist/src/lib/rtm/ExecutionContextWorker.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/ExecutionContextWorker.cpp	2016-10-13 04:39:44 UTC (rev 2779)
+++ trunk/OpenRTM-aist/src/lib/rtm/ExecutionContextWorker.cpp	2016-10-13 04:56:17 UTC (rev 2780)
@@ -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;
   }



More information about the openrtm-commit mailing list