[openrtm-commit:01101] r588 - trunk/OpenRTM-aist-Python/OpenRTM_aist

openrtm @ openrtm.org openrtm @ openrtm.org
2013年 6月 4日 (火) 00:11:05 JST


Author: kurihara
Date: 2013-06-04 00:11:04 +0900 (Tue, 04 Jun 2013)
New Revision: 588

Modified:
   trunk/OpenRTM-aist-Python/OpenRTM_aist/PeriodicExecutionContext.py
Log:
The termination processing of a thread has been added. refs #2703

Modified: trunk/OpenRTM-aist-Python/OpenRTM_aist/PeriodicExecutionContext.py
===================================================================
--- trunk/OpenRTM-aist-Python/OpenRTM_aist/PeriodicExecutionContext.py	2013-05-17 01:39:30 UTC (rev 587)
+++ trunk/OpenRTM-aist-Python/OpenRTM_aist/PeriodicExecutionContext.py	2013-06-03 15:11:04 UTC (rev 588)
@@ -591,6 +591,21 @@
     return RTC.RTC_OK
 
 
+  def onStopped(self):
+    guard = OpenRTM_aist.ScopedLock(self._svcmutex)
+    self._svc = False
+    del guard
+
+    guard = OpenRTM_aist.ScopedLock(self._workerthread._mutex)
+    self._workerthread._cond.acquire()
+    self._workerthread._running = True
+    self._workerthread._cond.notify()
+    self._workerthread._cond.release()
+    del guard
+    self.wait()
+    return RTC.RTC_OK
+
+
   # virtual RTC::ReturnCode_t
   # onWaitingActivated(RTC_impl::RTObjectStateMachine* comp, long int count);
   def onWaitingActivated(self, comp, count):



More information about the openrtm-commit mailing list