Added more correct signal handling to unix timers.
authoretisserant
Tue, 19 Aug 2008 17:30:13 +0200
changeset 507 c613e6cd34fa
parent 506 c17e2e17aca8
child 508 08adb8d4b098
Added more correct signal handling to unix timers.
drivers/timers_unix/timers_unix.c
--- a/drivers/timers_unix/timers_unix.c	Tue Jul 29 17:20:45 2008 +0200
+++ b/drivers/timers_unix/timers_unix.c	Tue Aug 19 17:30:13 2008 +0200
@@ -73,6 +73,24 @@
 	LeaveMutex();
 }
 
+void canReceiveLoop_signal(int sig)
+{
+}
+/* We assume that ReceiveLoop_task_proc is always the same */
+static void (*rtai_ReceiveLoop_task_proc)(CAN_PORT) = NULL;
+
+/**
+ * Enter in realtime and start the CAN receiver loop
+ * @param port
+ */
+void unixtimer_canReceiveLoop(CAN_PORT port)
+{
+       
+    /*get signal*/
+    signal(SIGTERM, canReceiveLoop_signal);
+    rtai_ReceiveLoop_task_proc(port);
+}
+
 void CreateReceiveTask(CAN_PORT port, TASK_HANDLE* Thread, void* ReceiveLoopPtr)
 {
 	pthread_create(Thread, NULL, ReceiveLoopPtr, (void*)port);