[openrtm-commit:02760] r1020 - trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC

openrtm @ openrtm.org openrtm @ openrtm.org
2017年 8月 18日 (金) 15:19:00 JST


Author: t-katami
Date: 2017-08-18 15:19:00 +0900 (Fri, 18 Aug 2017)
New Revision: 1020

Modified:
   trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/PeriodicTask.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/PeriodicTask.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/PeriodicTask.java	2017-08-18 02:56:24 UTC (rev 1019)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/PeriodicTask.java	2017-08-18 06:19:00 UTC (rev 1020)
@@ -89,6 +89,7 @@
         synchronized (m_suspend.mutex) {
             m_suspend.suspend = false;
             try {
+                m_suspend.signal = false;
                 m_suspend.mutex.notify();
             }
             catch(java.lang.IllegalMonitorStateException e) {
@@ -127,6 +128,7 @@
         synchronized (m_suspend.mutex) {
             m_suspend.suspend = false;
             try {
+                m_suspend.signal = false;
                 m_suspend.mutex.notify();
             }
             catch(java.lang.IllegalMonitorStateException e) {
@@ -147,6 +149,7 @@
     public void signal() {
         synchronized (m_suspend.mutex) {
             try {
+                m_suspend.signal = false;
                 m_suspend.mutex.notify();
             }
             catch(java.lang.IllegalMonitorStateException e) {
@@ -370,11 +373,14 @@
             { // wait if suspended
               synchronized (m_suspend.mutex) {
                   if (m_suspend.suspend) {
-                      try {
-                          m_suspend.mutex.wait();
+                      while(m_suspend.signal){
+                          try {
+                              m_suspend.mutex.wait();
+                          }
+                          catch(InterruptedException e ){
+                          }
                       }
-                      catch(InterruptedException e ){
-                      }
+                      m_suspend.signal = true;
                       // break if finalized
                       if (!m_alive.value)
                         {
@@ -517,6 +523,7 @@
        */
       public suspend_t(boolean sus){
           suspend = sus;
+          signal = true;
       }
       /**
        * {@.ja フラグ格納用変数}
@@ -528,6 +535,11 @@
        * {@.en Variable for exclusive control}
        */
       public String mutex = new String();
+      /**
+       * {@.ja フラグ格納用変数}
+       * {@.en Variable for flag storage}
+       */
+      public boolean signal;
     };
     /**
      * {@.ja タスク中断情報}



More information about the openrtm-commit mailing list