[openrtm-commit:02654] r3006 - trunk/OpenRTM-aist/src/lib/coil/vxworks/coil

openrtm @ openrtm.org openrtm @ openrtm.org
2017年 6月 27日 (火) 15:29:09 JST


Author: miyamoto
Date: 2017-06-27 15:29:09 +0900 (Tue, 27 Jun 2017)
New Revision: 3006

Modified:
   trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/Task.cpp
   trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/Task.h
   trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/UUID.cpp
Log:
[compat, VxWorks] fixed bug.

Modified: trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/Task.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/Task.cpp	2017-06-26 10:01:49 UTC (rev 3005)
+++ trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/Task.cpp	2017-06-27 06:29:09 UTC (rev 3006)
@@ -137,7 +137,8 @@
     if (m_count > 0)
       {
 #ifdef __RTP__
-        taskExit(m_tid);
+        Guard guard(m_waitmutex);
+        //taskExit(0);
 #else
         void* retval;
         ::pthread_join(m_thread, &retval);
@@ -208,6 +209,9 @@
 #endif
   {
     Task* t = (coil::Task*)args;
+#ifdef __RTP__
+    Guard guard(t->m_waitmutex);
+#endif
     int status;
     status = t->svc();
     t->finalize();

Modified: trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/Task.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/Task.h	2017-06-26 10:01:49 UTC (rev 3005)
+++ trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/Task.h	2017-06-27 06:29:09 UTC (rev 3006)
@@ -22,6 +22,8 @@
 #ifdef __RTP__
 #include <vxWorks.h>
 #include <taskLib.h>
+#include <coil/Mutex.h>
+#include <coil/Guard.h>
 #else
 #include <pthread.h>
 #endif
@@ -43,6 +45,9 @@
    */
   class Task
   {
+#ifdef __RTP__
+  typedef coil::Guard<coil::Mutex> Guard;
+#endif
   public:
     /*!
      * @if jp
@@ -298,7 +303,9 @@
      */
     void set_stacksize(int stacksize);
 #endif
-
+#ifdef __RTP__
+    coil::Mutex m_waitmutex;
+#endif
   private:
     int m_count;
 #ifdef __RTP__

Modified: trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/UUID.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/UUID.cpp	2017-06-26 10:01:49 UTC (rev 3005)
+++ trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/UUID.cpp	2017-06-27 06:29:09 UTC (rev 3006)
@@ -110,7 +110,7 @@
   {
 	  std::string result;
 	  
-	  result += StringToUUID<uint32_t>(_uuid.time_low,8);
+	  result = StringToUUID<uint32_t>(_uuid.time_low,8);
 	  result += "-";
 	  result += StringToUUID<uint16_t>(_uuid.time_mid,4);
 	  result += "-";
@@ -122,7 +122,7 @@
 	  result += StringToUUID<uint32_t>(_uuid.node_low,8);
 	  result += StringToUUID<uint16_t>(_uuid.node_high,4);
 	  
-	  return result.c_str();
+	  return strdup(result.c_str());
   }
 
 



More information about the openrtm-commit mailing list