]> rtime.felk.cvut.cz Git - CanFestival-3.git/commitdiff
Added more correct signal handling to unix timers.
authoretisserant <etisserant>
Tue, 19 Aug 2008 16:02:02 +0000 (16:02 +0000)
committeretisserant <etisserant>
Tue, 19 Aug 2008 16:02:02 +0000 (16:02 +0000)
drivers/timers_unix/timers_unix.c

index 39b8dccfd01f520023d29619159e3d05d6e54f7b..a32313075b8a8f4019e478dd443738ac7e960606 100644 (file)
@@ -77,7 +77,7 @@ void canReceiveLoop_signal(int sig)
 {
 }
 /* We assume that ReceiveLoop_task_proc is always the same */
-static void (*rtai_ReceiveLoop_task_proc)(CAN_PORT) = NULL;
+static void (*unixtimer_ReceiveLoop_task_proc)(CAN_PORT) = NULL;
 
 /**
  * Enter in realtime and start the CAN receiver loop
@@ -88,12 +88,13 @@ void unixtimer_canReceiveLoop(CAN_PORT port)
        
     /*get signal*/
     signal(SIGTERM, canReceiveLoop_signal);
-    rtai_ReceiveLoop_task_proc(port);
+    unixtimer_ReceiveLoop_task_proc(port);
 }
 
 void CreateReceiveTask(CAN_PORT port, TASK_HANDLE* Thread, void* ReceiveLoopPtr)
 {
-       pthread_create(Thread, NULL, ReceiveLoopPtr, (void*)port);
+    unixtimer_ReceiveLoop_task_proc = ReceiveLoopPtr;
+       pthread_create(Thread, NULL, unixtimer_canReceiveLoop, (void*)port);
 }
 
 void WaitReceiveTaskEnd(TASK_HANDLE *Thread)