Added more correct signal handling to unix timers.
authoretisserant
Tue, 19 Aug 2008 18:02:02 +0200
changeset 508 08adb8d4b098
parent 507 c613e6cd34fa
child 509 88c2ea321049
Added more correct signal handling to unix timers.
drivers/timers_unix/timers_unix.c
--- a/drivers/timers_unix/timers_unix.c	Tue Aug 19 17:30:13 2008 +0200
+++ b/drivers/timers_unix/timers_unix.c	Tue Aug 19 18:02:02 2008 +0200
@@ -77,7 +77,7 @@
 {
 }
 /* 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 @@
        
     /*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)