From fad7b9788d996ec46eaf3de4337008f0f5b76083 Mon Sep 17 00:00:00 2001 From: etisserant Date: Tue, 19 Aug 2008 16:02:02 +0000 Subject: [PATCH] Added more correct signal handling to unix timers. --- drivers/timers_unix/timers_unix.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/timers_unix/timers_unix.c b/drivers/timers_unix/timers_unix.c index 39b8dcc..a323130 100644 --- a/drivers/timers_unix/timers_unix.c +++ b/drivers/timers_unix/timers_unix.c @@ -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) -- 2.39.2