commit 8378a78b2d9c66f1f55430c500b90a8ef7e903c1
Author: Svenja <skenneweg@techfak.uni-bielefeld.de>
Date:   Wed Jul 15 17:13:49 2020 +0200

    Work in main function of the node and subscriber

diff --git a/src/urt_node.c b/src/urt_node.c
index 40a9f6d..2d3e252 100644
--- a/src/urt_node.c
+++ b/src/urt_node.c
@@ -70,7 +70,7 @@ void _main(void* arg)
   }
 
 
-  while (/*!*/urtThreadShouldTerminate()) //TODO: uncomment
+  while (urtThreadShouldTerminate())
   {
     urt_osEventMask_t temp = urtEventWait(mask, URT_EVENT_WAIT_ONE, URT_DELAY_INFINITE);
     if (temp == urtCoreGetEventMask())
@@ -92,6 +92,7 @@ void _main(void* arg)
   }
   urtEventUnregister(urtCoreGetEvtSource(), &((urt_node_t*)arg)->listener);
   urt_osThread_t* threadToTerminate = ((urt_node_t*)arg)->thread;
+  //urt_osThread_t* threadToTerminate = urtThreadGetSelf();
   while (threadToTerminate->children != NULL || threadToTerminate->sibling != NULL)
   {
     if (threadToTerminate->children != NULL)
@@ -99,7 +100,6 @@ void _main(void* arg)
     if(threadToTerminate->sibling != NULL)
       urtThreadTerminate(threadToTerminate->sibling, URT_THREAD_TERMINATE_REQUEST);
   }
-  urtThreadTerminate(threadToTerminate, URT_THREAD_TERMINATE_REQUEST);
 
   urt_osThread_t* threadToJoin = ((urt_node_t*)arg)->thread;
   while (threadToJoin->children != NULL || threadToJoin->sibling != NULL)
@@ -109,8 +109,8 @@ void _main(void* arg)
     if(threadToJoin->sibling != NULL)
       urtThreadJoin(threadToJoin->sibling);
   }
-  //urtThreadJoin(threadToJoin); //TODO: uncomment
 
+  urtThreadExit();
   return;
 }
 
diff --git a/src/urt_subscriber.c b/src/urt_subscriber.c
index 5716ba9..ea9883d 100644
--- a/src/urt_subscriber.c
+++ b/src/urt_subscriber.c
@@ -103,7 +103,7 @@ urt_status_t urtNrtSubscriberSubscribe (urt_nrtsubscriber_t* subscriber, urt_top
   subscriber->base.lastMessage = topic->latestMessage;
   subscriber->base.lastMessageTime = topic->latestMessage->originTime;
 
-  urtEventRegister(topic->evtSource, subscriber->base.evtListener, URT_EVENTMASK_MAXPRIO, URT_EVENTFLAG_PROCEED); //TODO: Correct mask, flag?
+  urtEventRegister(topic->evtSource, subscriber->base.evtListener, subscriber->base.evtListener.events, subscriber->base.evtListener.flags);
 
 #if (URT_CFG_PUBSUB_PROFILING == true)
     topic->numHrtSubscribers--;
@@ -253,7 +253,7 @@ urt_status_t urtSrtSubscriberSubscribe(urt_srtsubscriber_t* subscriber, urt_topi
   subscriber->base.lastMessage = topic->latestMessage;
   subscriber->base.lastMessageTime = topic->latestMessage->originTime;
 
-  urtEventRegister(topic->evtSource, subscriber->base.evtListener, URT_EVENTMASK_MAXPRIO, URT_EVENTFLAG_PROCEED); //TODO: Correct mask, flag?
+  urtEventRegister(topic->evtSource, subscriber->base.evtListener, subscriber->base.evtListener.events, subscriber->base.evtListener.flags);
 
 # if (URT_CFG_PUBSUB_PROFILING == true)
     topic->numHrtSubscribers--;
@@ -433,7 +433,7 @@ urt_status_t urtFrtSubscriberSubscribe(urt_frtsubscriber_t* subscriber, urt_topi
   subscriber->base.lastMessage = topic->latestMessage;
   subscriber->base.lastMessageTime = topic->latestMessage->originTime;
 
-  urtEventRegister(topic->evtSource, subscriber->base.evtListener, URT_EVENTMASK_MAXPRIO, URT_EVENTFLAG_PROCEED); //TODO: Correct mask, flag?
+  urtEventRegister(topic->evtSource, subscriber->base.evtListener, subscriber->base.evtListener.events, subscriber->base.evtListener.flags);
 
 # if (URT_CFG_PUBSUB_PROFILING == true)
   topic->numHrtSubscribers--;
@@ -631,24 +631,10 @@ urt_status_t urtHrtSubscriberSubscribe(urt_hrtsubscriber_t* subscriber, urt_topi
   subscriber->base.lastMessage = topic->latestMessage;
   subscriber->base.lastMessageTime = topic->latestMessage->originTime;
 
-  urtEventRegister(topic->evtSource, subscriber->base.evtListener, URT_EVENTMASK_MAXPRIO, URT_EVENTFLAG_PROCEED); //TODO: Correct mask, flag?
+  urtEventRegister(topic->evtSource, subscriber->base.evtListener, subscriber->base.evtListener.events, subscriber->base.evtListener.flags);
 
 # if(URT_CFG_PUBSUB_QOS_RATECHECKS == true)
-  urt_hrtsubscriber_t* hrtSubscriber = subscriber->base.topic->hrtSubscribers;
-  while (!hrtSubscriber /* && expected Rate is lower */)
-  {
-      hrtSubscriber = hrtSubscriber->next;
-  }
-
-  if (!hrtSubscriber)
-  {
-    //TODO: Append self to topic's list of HRT subscribers
-  }
-  else
-  {
-    //TOOD: insert self in front of current HRT susbcriber
-    subscriber->next = hrtSubscriber;
-  }
+  //TODO: Implement
 # endif /* URT_CFG_PUBSUB_QOS_RATECHECKS */
 
   topic->numHrtSubscribers--;
