commit 408b49ced4cef056194315f3d612d1fd339bcccc
Author: skenneweg <skenneweg@techfak.uni-bielefeld.de>
Date:   Mon Jun 29 19:41:44 2020 +0200

    Little change in the main function of the node (used argument directly)

diff --git a/src/urt_node.c b/src/urt_node.c
index df41337..5fbde1c 100644
--- a/src/urt_node.c
+++ b/src/urt_node.c
@@ -48,36 +48,35 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 void _main(void* arg)
 {
-  urt_node_t* localNode = (urt_node_t*)arg;
   urt_osEventMask_t mask;
   urt_osEventFlags_t flag = 0;
-  urtEventRegister(urtCoreGetEvtSource(), &(localNode->listener), mask, flag);
-  if (localNode->setupcallback != NULL)
+  urtEventRegister(urtCoreGetEvtSource(), &(((urt_node_t*)arg)->listener), mask, flag);
+  if (((urt_node_t*)arg)->setupcallback != NULL)
   {
-    mask = localNode->setupcallback(localNode, localNode->setupparams);
+    mask = ((urt_node_t*)arg)->setupcallback(((urt_node_t*)arg), ((urt_node_t*)arg)->setupparams);
     if (mask == urtCoreGetEventMask())
     {
-        urtCoreStopNodes(URT_STATUS_NODE_INVALEVTMASK);
+      urtCoreStopNodes(URT_STATUS_NODE_INVALEVTMASK);
     }
   }
   else
   {
-     mask = URT_EVENTMASK_ALL;
+    mask = URT_EVENTMASK_ALL;
   }
 
   if (urtCoreGetStatus() == URT_STATUS_OK)
   {
-    urtCoreSynchronizeNodes(localNode);
+    urtCoreSynchronizeNodes(((urt_node_t*)arg));
   }
 
-  if (!urtThreadShouldTerminate())
+  while (!urtThreadShouldTerminate())
   {
     urt_osEventMask_t temp = urtEventWait(mask, URT_EVENT_WAIT_ONE, URT_DELAY_INFINITE);
     if (temp == urtCoreGetEventMask())
     {
-      localNode->loopcallback(localNode, mask, localNode->loopparams);
+      ((urt_node_t*)arg)->loopcallback(((urt_node_t*)arg), mask, ((urt_node_t*)arg)->loopparams);
       #if (URT_CFG_PUBSUB_PROFILING || URT_CFG_RPC_PROFILING)
-        localNode->loops++;
+        ((urt_node_t*)arg)->loops++;
       #endif /* URT_CFG_PUBSUB_PROFILING || URT_CFG_RPC_PROFILING */
       if (mask == urtCoreGetEventMask())
       {
@@ -86,13 +85,13 @@ void _main(void* arg)
     }
   }
 
-  if (localNode->shutdowncallback)
+  if (((urt_node_t*)arg)->shutdowncallback != NULL)
   {
-    localNode->shutdowncallback(localNode, urtCoreGetStatus(), localNode->shutdownparams);
+    ((urt_node_t*)arg)->shutdowncallback(((urt_node_t*)arg), urtCoreGetStatus(), ((urt_node_t*)arg)->shutdownparams);
   }
-  urtEventUnregister(urtCoreGetEvtSource(), &localNode->listener);
+  urtEventUnregister(urtCoreGetEvtSource(), &((urt_node_t*)arg)->listener);
 
-  urt_osThread_t* threadToTerminate = localNode->thread;
+  urt_osThread_t* threadToTerminate = ((urt_node_t*)arg)->thread;
   while (threadToTerminate->children != NULL || threadToTerminate->sibling != NULL)
   {
     if (threadToTerminate->children != NULL)
@@ -102,7 +101,7 @@ void _main(void* arg)
   }
   urtThreadTerminate(threadToTerminate, URT_THREAD_TERMINATE_REQUEST);
 
-  urt_osThread_t* threadToJoin = localNode->thread;
+  urt_osThread_t* threadToJoin = ((urt_node_t*)arg)->thread;
   while (threadToJoin->children != NULL || threadToJoin->sibling != NULL)
   {
     if (threadToJoin->children != NULL)
@@ -123,7 +122,7 @@ void _main(void* arg)
  * @brief  Initalize a node.
  *
  * @param[in] node  The node to initialize. Must not be NULL.
- * @param[in] thread  The thread to intialize. Must be NULL.
+ * @param[in] thread  The thread to intialize.
  * @param[in] setupcallback  Callback function to be executed during setup.
  *                           May be NULL if no custom setup is required.
  * @param[in] setupparams  Parameters for the setup callback function.
@@ -143,12 +142,11 @@ void urtNodeInit(urt_node_t* node, urt_osThread_t* thread, urt_osThreadPrio_t pr
                  urt_nodeShutdownCallback_t shutdowncallback, void* shutdownparams)
 {
   urtDebugAssert(node != NULL);
-  urtDebugAssert(thread == NULL);
   if (setupcallback == NULL)
     urtDebugAssert(setupparams == NULL);
 
   node->next = NULL;
-  node->thread = urtThreadInit(thread, sizeof(thread), prio, _main, node);
+  node->thread = urtThreadInit((void*)thread, sizeof(thread), prio, (urt_osThreadFunction_t) _main, (void*)node);
   node->setupcallback = setupcallback;
   node->setupparams = setupparams;
   node->loopcallback = loopcallback;
