[openrtm-commit:02745] r1006 - in trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC: buffer port
openrtm @ openrtm.org
openrtm @ openrtm.org
2017年 8月 16日 (水) 16:27:34 JST
Author: t-katami
Date: 2017-08-16 16:27:34 +0900 (Wed, 16 Aug 2017)
New Revision: 1006
Modified:
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/buffer/RingBuffer.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPort.java
Log:
[compat,bugfix,->RELENG_1_2] Fixed the items pointed out by the static code analysis tool.
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/buffer/RingBuffer.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/buffer/RingBuffer.java 2017-08-16 04:22:10 UTC (rev 1005)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/buffer/RingBuffer.java 2017-08-16 07:27:34 UTC (rev 1006)
@@ -417,8 +417,10 @@
local_nsec = (int)(m_rtimeout.usec() % 1000)*1000;
}
if (readback && !timedread) { // "readback" mode
- if (!(m_wcount > 0)) {
- return ReturnCode.BUFFER_EMPTY;
+ synchronized (m_posmutex) {
+ if (!(m_wcount > 0)) {
+ return ReturnCode.BUFFER_EMPTY;
+ }
}
advanceRptr(-1);
}
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPort.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPort.java 2017-08-16 04:22:10 UTC (rev 1005)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPort.java 2017-08-16 07:27:34 UTC (rev 1006)
@@ -441,11 +441,13 @@
if (ret.equals(ReturnCode.CONNECTION_LOST)) {
rtcout.println(Logbuf.TRACE, "connection_lost id: "+id);
- if(m_onConnectionLost != null) {
- RTC.ConnectorProfile prof = findConnProfile(id);
- RTC.ConnectorProfileHolder holder
- = new RTC.ConnectorProfileHolder(prof);
- m_onConnectionLost.run(holder);
+ synchronized (m_onConnectionLost_mutex){
+ if(m_onConnectionLost != null) {
+ RTC.ConnectorProfile prof = findConnProfile(id);
+ RTC.ConnectorProfileHolder holder
+ = new RTC.ConnectorProfileHolder(prof);
+ m_onConnectionLost.run(holder);
+ }
}
disconnect_ids.add(id);
}
More information about the openrtm-commit
mailing list