[openrtm-commit:03181] r1111 - in trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC: . executionContext
openrtm @ openrtm.org
openrtm @ openrtm.org
2018年 2月 23日 (金) 09:56:46 JST
Author: t-katami
Date: 2018-02-23 09:56:46 +0900 (Fri, 23 Feb 2018)
New Revision: 1111
Modified:
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/RTObject_impl.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/EventDrivenExecutionContext.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExtTrigExecutionContext.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/PeriodicExecutionContext.java
Log:
[compat,bugfix,->RELENG_1_2] Added destruction processing of EC. refs #4453
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java 2018-02-08 07:36:20 UTC (rev 1110)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java 2018-02-23 00:56:46 UTC (rev 1111)
@@ -2405,7 +2405,7 @@
}
else {
rtcout.println(Logbuf.DEBUG,
- "Factory not found: "+comp_id.getProperty("implementation_id"));
+ "Factory found: "+comp_id.getProperty("implementation_id"));
factory.destroy(comp);
}
String shutdown_on_nortcs
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/RTObject_impl.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/RTObject_impl.java 2018-02-08 07:36:20 UTC (rev 1110)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/RTObject_impl.java 2018-02-23 00:56:46 UTC (rev 1111)
@@ -4041,6 +4041,9 @@
}
catch(Exception ex) {
}
+ ExecutionContextFactory<ExecutionContextBase,String> factory
+ = ExecutionContextFactory.instance();
+ factory.deleteObject(m_eclist.get(i));
}
if (!m_eclist.isEmpty()) {
m_eclist.clear();
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/EventDrivenExecutionContext.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/EventDrivenExecutionContext.java 2018-02-08 07:36:20 UTC (rev 1110)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/EventDrivenExecutionContext.java 2018-02-23 00:56:46 UTC (rev 1111)
@@ -1564,6 +1564,25 @@
*
*/
public void destructor_(Object obj) {
+ if(obj != this){
+ ((EventDrivenExecutionContext)obj).destructor_(obj);
+ return;
+ }
+ synchronized(m_svcmutex) {
+ m_svc = false;
+ }
+ synchronized (m_workerthread.mutex_) {
+ if(m_workerthread.running_ == false)
+ {
+ m_workerthread.running_ = true ;
+ m_workerthread.mutex_.notifyAll();
+ }
+ }
+ try {
+ wait();
+ } catch( InterruptedException e) {
+ e.printStackTrace();
+ }
obj = null;
}
/**
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExtTrigExecutionContext.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExtTrigExecutionContext.java 2018-02-08 07:36:20 UTC (rev 1110)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExtTrigExecutionContext.java 2018-02-23 00:56:46 UTC (rev 1111)
@@ -1494,6 +1494,25 @@
*
*/
public void destructor_(Object obj) {
+ if(obj != this){
+ ((ExtTrigExecutionContext)obj).destructor_(obj);
+ return;
+ }
+ synchronized(m_svcmutex) {
+ m_svc = false;
+ }
+ synchronized (m_workerthread.mutex_) {
+ if(m_workerthread.ticked_ == false)
+ {
+ m_workerthread.ticked_ = true ;
+ m_workerthread.mutex_.notifyAll();
+ }
+ }
+ try {
+ wait();
+ } catch( InterruptedException e) {
+ e.printStackTrace();
+ }
obj = null;
}
/**
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/PeriodicExecutionContext.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/PeriodicExecutionContext.java 2018-02-08 07:36:20 UTC (rev 1110)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/PeriodicExecutionContext.java 2018-02-23 00:56:46 UTC (rev 1111)
@@ -210,7 +210,6 @@
++count;
} while (threadRunning());
-
return 0;
}
@@ -1621,7 +1620,26 @@
*
*/
public void destructor_(Object obj) {
- obj = null;
+
+ if(obj != this){
+ ((PeriodicExecutionContext)obj).destructor_(obj);
+ return;
+ }
+ synchronized(m_svcmutex) {
+ m_svc = false;
+ }
+ synchronized (m_workerthread.mutex_) {
+ if(m_workerthread.running_ == false)
+ {
+ m_workerthread.running_ = true ;
+ m_workerthread.mutex_.notifyAll();
+ }
+ }
+ try {
+ wait();
+ } catch( InterruptedException e) {
+ e.printStackTrace();
+ }
}
/**
* <p>ExecutionContextのインスタンスを取得します。</p>
More information about the openrtm-commit
mailing list