Added more correct signal handling to unix timers.
--- 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)