[openrtm-commit:02701] r976 - in branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC: . SDOPackage port util/clock
openrtm @ openrtm.org
openrtm @ openrtm.org
2017年 7月 24日 (月) 13:54:42 JST
Author: kawauchi
Date: 2017-07-24 13:54:42 +0900 (Mon, 24 Jul 2017)
New Revision: 976
Modified:
branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/BufferFactory.java
branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/FactoryGlobal.java
branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/InPortConsumerFactory.java
branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/InPortProviderFactory.java
branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java
branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/NumberingPolicyFactory.java
branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/OutPortConsumerFactory.java
branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/OutPortProviderFactory.java
branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/PeriodicTask.java
branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/PeriodicTaskFactory.java
branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/PublisherBaseFactory.java
branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/SDOPackage/Configuration_impl.java
branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/SDOPackage/Organization_impl.java
branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPort.java
branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/util/clock/AdjustedClock.java
branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/util/clock/LogicalClock.java
Log:
[merge] r965-975 have been merged from trunk.
Modified: branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/BufferFactory.java
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/BufferFactory.java 2017-07-19 08:38:34 UTC (rev 975)
+++ branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/BufferFactory.java 2017-07-24 04:54:42 UTC (rev 976)
@@ -20,16 +20,12 @@
* {@.ja BufferFactoryオブジェクト}
* {@.en BufferFactory object}
*/
- public static BufferFactory instance() {
+ synchronized public static BufferFactory instance() {
if (factory_global == null) {
- synchronized (factory_global_mutex) {
- if (factory_global == null) {
- try {
- factory_global = new BufferFactory();
- } catch (Exception e) {
- factory_global = null;
- }
- }
+ try {
+ factory_global = new BufferFactory();
+ } catch (Exception e) {
+ factory_global = null;
}
}
@@ -36,10 +32,6 @@
return factory_global;
}
/**
- * <p> mutex </p>
- */
- private static String factory_global_mutex = new String();
- /**
* <p> object </p>
*/
private static BufferFactory factory_global;
Modified: branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/FactoryGlobal.java
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/FactoryGlobal.java 2017-07-19 08:38:34 UTC (rev 975)
+++ branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/FactoryGlobal.java 2017-07-24 04:54:42 UTC (rev 976)
@@ -69,16 +69,12 @@
* {@.ja FactoryGlobal オブジェクト}
* {@.en FactoryGlobal object}
*/
- public static FactoryGlobal instance() {
+ synchronized public static FactoryGlobal instance() {
if (factory_global == null) {
- synchronized (factory_global_mutex) {
- if (factory_global == null) {
- try {
- factory_global = new FactoryGlobal();
- } catch (Exception e) {
- factory_global = null;
- }
- }
+ try {
+ factory_global = new FactoryGlobal();
+ } catch (Exception e) {
+ factory_global = null;
}
}
Modified: branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/InPortConsumerFactory.java
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/InPortConsumerFactory.java 2017-07-19 08:38:34 UTC (rev 975)
+++ branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/InPortConsumerFactory.java 2017-07-24 04:54:42 UTC (rev 976)
@@ -25,16 +25,12 @@
* {@.en InPortConsumerFactory object}
*
*/
- public static InPortConsumerFactory instance() {
+ synchronized public static InPortConsumerFactory instance() {
if (factory_global == null) {
- synchronized (factory_global_mutex) {
- if (factory_global == null) {
- try {
- factory_global = new InPortConsumerFactory();
- } catch (Exception e) {
- factory_global = null;
- }
- }
+ try {
+ factory_global = new InPortConsumerFactory();
+ } catch (Exception e) {
+ factory_global = null;
}
}
@@ -41,10 +37,6 @@
return factory_global;
}
/**
- * <p> mutex </p>
- */
- private static String factory_global_mutex = new String();
- /**
* <p> object </p>
*/
private static InPortConsumerFactory factory_global;
Modified: branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/InPortProviderFactory.java
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/InPortProviderFactory.java 2017-07-19 08:38:34 UTC (rev 975)
+++ branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/InPortProviderFactory.java 2017-07-24 04:54:42 UTC (rev 976)
@@ -1,5 +1,7 @@
package jp.go.aist.rtm.RTC;
+import java.lang.Object;
+
/**
* {@.ja InPortProvider用ファクトリの実装}
* {@.en Implement of factory for InPortProvider}
@@ -26,16 +28,12 @@
* {@.en InPortProviderFactory object}
*
*/
- public static InPortProviderFactory instance() {
+ synchronized public static InPortProviderFactory instance() {
if (factory_global == null) {
- synchronized (factory_global_mutex) {
- if (factory_global == null) {
- try {
- factory_global = new InPortProviderFactory();
- } catch (Exception e) {
- factory_global = null;
- }
- }
+ try {
+ factory_global = new InPortProviderFactory();
+ } catch (Exception e) {
+ factory_global = null;
}
}
@@ -42,10 +40,6 @@
return factory_global;
}
/**
- * <p> mutex </p>
- */
- private static String factory_global_mutex = new String();
- /**
* <p> object </p>
*/
private static InPortProviderFactory factory_global;
Modified: branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java 2017-07-19 08:38:34 UTC (rev 975)
+++ branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java 2017-07-24 04:54:42 UTC (rev 976)
@@ -1863,6 +1863,7 @@
"naming.enable",
"naming.type",
"naming.formats",
+ "manager.instance_name",
""
};
@@ -3661,8 +3662,9 @@
if (!(m_config.getProperty(type_conf) == null
|| m_config.getProperty(type_conf).length() == 0)) {
+ BufferedReader conff;
try {
- BufferedReader conff = new BufferedReader(
+ conff = new BufferedReader(
new FileReader(m_config.getProperty(type_conf)));
type_prop.load(conff);
rtcout.println(Logbuf.INFO,
Modified: branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/NumberingPolicyFactory.java
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/NumberingPolicyFactory.java 2017-07-19 08:38:34 UTC (rev 975)
+++ branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/NumberingPolicyFactory.java 2017-07-24 04:54:42 UTC (rev 976)
@@ -27,16 +27,12 @@
* {@.en InPortProviderFactory object}
*
*/
- public static NumberingPolicyFactory instance() {
+ synchronized public static NumberingPolicyFactory instance() {
if (factory_global == null) {
- synchronized (factory_global_mutex) {
- if (factory_global == null) {
- try {
- factory_global = new NumberingPolicyFactory();
- } catch (Exception e) {
- factory_global = null;
- }
- }
+ try {
+ factory_global = new NumberingPolicyFactory();
+ } catch (Exception e) {
+ factory_global = null;
}
}
Modified: branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/OutPortConsumerFactory.java
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/OutPortConsumerFactory.java 2017-07-19 08:38:34 UTC (rev 975)
+++ branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/OutPortConsumerFactory.java 2017-07-24 04:54:42 UTC (rev 976)
@@ -25,16 +25,12 @@
* {@.en OutPortConsumerFactory object}
*
*/
- public static OutPortConsumerFactory instance() {
+ synchronized public static OutPortConsumerFactory instance() {
if (factory_global == null) {
- synchronized (factory_global_mutex) {
- if (factory_global == null) {
- try {
- factory_global = new OutPortConsumerFactory();
- } catch (Exception e) {
- factory_global = null;
- }
- }
+ try {
+ factory_global = new OutPortConsumerFactory();
+ } catch (Exception e) {
+ factory_global = null;
}
}
@@ -41,10 +37,6 @@
return factory_global;
}
/**
- * <p> mutex </p>
- */
- private static String factory_global_mutex = new String();
- /**
* <p> object </p>
*/
private static OutPortConsumerFactory factory_global;
Modified: branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/OutPortProviderFactory.java
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/OutPortProviderFactory.java 2017-07-19 08:38:34 UTC (rev 975)
+++ branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/OutPortProviderFactory.java 2017-07-24 04:54:42 UTC (rev 976)
@@ -25,16 +25,12 @@
* {@.en OutPortProviderFactory object}
*
*/
- public static OutPortProviderFactory instance() {
+ synchronized public static OutPortProviderFactory instance() {
if (factory_global == null) {
- synchronized (factory_global_mutex) {
- if (factory_global == null) {
- try {
- factory_global = new OutPortProviderFactory();
- } catch (Exception e) {
- factory_global = null;
- }
- }
+ try {
+ factory_global = new OutPortProviderFactory();
+ } catch (Exception e) {
+ factory_global = null;
}
}
@@ -41,11 +37,6 @@
return factory_global;
}
/**
- * {@.ja 排他制御用変数}
- * {@.en Variable for exclusive control}
- */
- private static String factory_global_mutex = new String();
- /**
* <p> object </p>
*/
private static OutPortProviderFactory factory_global;
Modified: branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/PeriodicTask.java
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/PeriodicTask.java 2017-07-19 08:38:34 UTC (rev 975)
+++ branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/PeriodicTask.java 2017-07-24 04:54:42 UTC (rev 976)
@@ -432,8 +432,8 @@
if (m_execCount > m_execCountMax) {
synchronized (m_execStat.mutex) {
m_execStat.stat = m_execTime.getStatistics();
- m_execCount = 0;
}
+ m_execCount = 0;
}
++m_execCount;
}
@@ -445,8 +445,8 @@
if (m_periodCount > m_periodCountMax) {
synchronized (m_periodStat.mutex) {
m_periodStat.stat = m_periodTime.getStatistics();
- m_periodCount = 0;
}
+ m_periodCount = 0;
}
++m_periodCount;
}
Modified: branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/PeriodicTaskFactory.java
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/PeriodicTaskFactory.java 2017-07-19 08:38:34 UTC (rev 975)
+++ branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/PeriodicTaskFactory.java 2017-07-24 04:54:42 UTC (rev 976)
@@ -25,16 +25,12 @@
* {@.en PeriodicTaskFactory object}
*
*/
- public static PeriodicTaskFactory instance() {
+ synchronized public static PeriodicTaskFactory instance() {
if (factory_global == null) {
- synchronized (factory_global_mutex) {
- if (factory_global == null) {
- try {
- factory_global = new PeriodicTaskFactory();
- } catch (Exception e) {
- factory_global = null;
- }
- }
+ try {
+ factory_global = new PeriodicTaskFactory();
+ } catch (Exception e) {
+ factory_global = null;
}
}
@@ -41,10 +37,6 @@
return factory_global;
}
/**
- * <p> mutex </p>
- */
- private static String factory_global_mutex = new String();
- /**
* <p> object </p>
*/
private static PeriodicTaskFactory factory_global;
Modified: branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/PublisherBaseFactory.java
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/PublisherBaseFactory.java 2017-07-19 08:38:34 UTC (rev 975)
+++ branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/PublisherBaseFactory.java 2017-07-24 04:54:42 UTC (rev 976)
@@ -22,16 +22,12 @@
* {@.en PublisherBaseFactory object}
*
*/
- public static PublisherBaseFactory instance() {
+ synchronized public static PublisherBaseFactory instance() {
if (factory_global == null) {
- synchronized (factory_global_mutex) {
- if (factory_global == null) {
- try {
- factory_global = new PublisherBaseFactory();
- } catch (Exception e) {
- factory_global = null;
- }
- }
+ try {
+ factory_global = new PublisherBaseFactory();
+ } catch (Exception e) {
+ factory_global = null;
}
}
@@ -38,10 +34,6 @@
return factory_global;
}
/**
- * <p> mutex </p>
- */
- private static String factory_global_mutex = new String();
- /**
* <p> object </p>
*/
private static PublisherBaseFactory factory_global;
Modified: branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/SDOPackage/Configuration_impl.java
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/SDOPackage/Configuration_impl.java 2017-07-19 08:38:34 UTC (rev 975)
+++ branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/SDOPackage/Configuration_impl.java 2017-07-24 04:54:42 UTC (rev 976)
@@ -198,8 +198,10 @@
rtcout.println(Logbuf.TRACE, "Configuration_impl.set_device_profile()");
try {
- if(m_deviceProfile == null) m_deviceProfile = new DeviceProfile();
- synchronized (m_deviceProfile) {
+ synchronized (m_device_profile_lock) {
+ if(m_deviceProfile == null) {
+ m_deviceProfile = new DeviceProfile();
+ }
m_deviceProfile = dProfile;
}
} catch(Exception ex) {
@@ -419,19 +421,21 @@
public Parameter[] get_configuration_parameters()
throws NotAvailable, InternalError {
- rtcout.println(Logbuf.TRACE, "Configuration_impl.get_configurations()");
+ rtcout.println(Logbuf.TRACE,
+ "Configuration_impl.get_configuration_parameters()");
try{
- if( m_parameters==null ) {
- m_parameters = new ParameterListHolder();
- m_parameters.value = new Parameter[0];
- }
- synchronized (m_parameters) {
+ synchronized (m_parameters_lock) {
+ if( m_parameters==null ) {
+ m_parameters = new ParameterListHolder();
+ m_parameters.value = new Parameter[0];
+ }
ParameterListHolder param = new ParameterListHolder(m_parameters.value);
return param.value;
}
} catch (Exception ex) {
- throw new InternalError("Configuration::get_configuration_parameters()");
+ throw new InternalError(
+ "Configuration::get_configuration_parameters()");
}
}
@@ -1022,6 +1026,7 @@
* {@.en DeviceProfile}
*/
protected DeviceProfile m_deviceProfile = new DeviceProfile();
+ protected final String m_device_profile_lock = new String();
/**
* {@.ja ServiceProfile リスト}
* {@.en List of ServiceProfile}
@@ -1032,6 +1037,7 @@
* {@.en List of Parameter}
*/
protected ParameterListHolder m_parameters;
+ protected final String m_parameters_lock = new String();
/**
* {@.ja コンフィギュレーションセット情報}
* {@.en Information of configuration set}
Modified: branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/SDOPackage/Organization_impl.java
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/SDOPackage/Organization_impl.java 2017-07-19 08:38:34 UTC (rev 975)
+++ branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/SDOPackage/Organization_impl.java 2017-07-24 04:54:42 UTC (rev 976)
@@ -218,8 +218,10 @@
throws InvalidParameter, NotAvailable, InternalError {
rtcout.println(Logbuf.TRACE, "Organization_impl.set_organization_property()");
try {
- if( m_orgProperty==null ) m_orgProperty = new OrganizationProperty();
- synchronized (m_orgProperty) {
+ synchronized (m_org_mutex) {
+ if( m_orgProperty==null ) {
+ m_orgProperty = new OrganizationProperty();
+ }
m_orgProperty = organization_property;
return true;
}
@@ -271,10 +273,13 @@
*/
public boolean add_organization_property(final OrganizationProperty organization_property)
throws SystemException, InvalidParameter, NotAvailable, InternalError {
- rtcout.println(Logbuf.TRACE, "Organization_impl.add_organization_property()");
+ rtcout.println(Logbuf.TRACE,
+ "Organization_impl.add_organization_property()");
try {
- if( m_orgProperty==null ) m_orgProperty = new OrganizationProperty();
- synchronized (m_orgProperty) {
+ synchronized (m_org_mutex) {
+ if( m_orgProperty==null ) {
+ m_orgProperty = new OrganizationProperty();
+ }
m_orgProperty = organization_property;
return true;
}
@@ -854,6 +859,7 @@
* member:property NVList
*/
OrganizationProperty m_orgProperty = new OrganizationProperty();
+ private final java.lang.Object m_org_mutex = new java.lang.Object();
/**
* {@.ja Organization プロパティ検索用ヘルパークラス}
*/
Modified: branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPort.java
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPort.java 2017-07-19 08:38:34 UTC (rev 975)
+++ branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPort.java 2017-07-24 04:54:42 UTC (rev 976)
@@ -364,7 +364,7 @@
rtcout.println(Logbuf.TRACE, "OnWrite called");
}
- synchronized (m_profile.properties) {
+ synchronized (m_profile_mutex) {
NVListHolder nvholder =
new NVListHolder(m_profile.properties);
try{
Modified: branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/util/clock/AdjustedClock.java
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/util/clock/AdjustedClock.java 2017-07-19 08:38:34 UTC (rev 975)
+++ branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/util/clock/AdjustedClock.java 2017-07-24 04:54:42 UTC (rev 976)
@@ -14,6 +14,7 @@
*/
public class AdjustedClock extends SystemClock {
private TimeValue m_offset;
+ private final Object m_lock = new Object();
public AdjustedClock() {
super();
@@ -21,7 +22,7 @@
}
public TimeValue getTime() {
- synchronized (m_offset) {
+ synchronized (m_lock) {
TimeValue base = super.getTime();
return base.minus(m_offset);
}
@@ -28,7 +29,7 @@
}
public boolean setTime(TimeValue clocktime) {
- synchronized (m_offset) {
+ synchronized (m_lock) {
long msec = System.currentTimeMillis();
long sec = msec/TIME_CONV_UNIT;
long usec = (msec - sec*TIME_CONV_UNIT)*TIME_CONV_UNIT;
Modified: branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/util/clock/LogicalClock.java
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/util/clock/LogicalClock.java 2017-07-19 08:38:34 UTC (rev 975)
+++ branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/util/clock/LogicalClock.java 2017-07-24 04:54:42 UTC (rev 976)
@@ -8,7 +8,7 @@
*
* <p>
* {@.ja このクラスは論理時間を設定または取得するクラスである。
-* 単純に settime() によって設定された時刻を gettime() によって取得する。}
+ * 単純に settime() によって設定された時刻を gettime() によって取得する。}
* {@.en This class sets and gets system clock.
* It just sets time by settime() and gets time by gettime().}
*/
@@ -15,6 +15,7 @@
public class LogicalClock implements IClock {
private TimeValue m_currentTime;
+ private final Object m_lock = new Object();
public LogicalClock() {
m_currentTime = new TimeValue(0.0);
@@ -21,13 +22,13 @@
}
public TimeValue getTime() {
- synchronized (m_currentTime) {
+ synchronized (m_lock) {
return m_currentTime;
}
}
public boolean setTime(TimeValue clocktime) {
- synchronized (m_currentTime) {
+ synchronized (m_lock) {
m_currentTime = clocktime;
}
return true;
More information about the openrtm-commit
mailing list