Fixed segfault on quit with Xenomai, due to bat parameter type in waitReceiveTaskEnd.
authoretisserant
Tue, 19 Feb 2008 14:52:40 +0100
changeset 401 2c90876b9751
parent 400 7d845f5d730c
child 402 77f875d45250
Fixed segfault on quit with Xenomai, due to bat parameter type in waitReceiveTaskEnd.
drivers/timers_unix/timers_unix.c
drivers/unix/unix.c
include/timers_driver.h
--- a/drivers/timers_unix/timers_unix.c	Mon Feb 18 17:14:22 2008 +0100
+++ b/drivers/timers_unix/timers_unix.c	Tue Feb 19 14:52:40 2008 +0100
@@ -73,10 +73,10 @@
 	pthread_create(Thread, NULL, ReceiveLoopPtr, (void*)port);
 }
 
-void WaitReceiveTaskEnd(TASK_HANDLE Thread)
+void WaitReceiveTaskEnd(TASK_HANDLE *Thread)
 {
-	pthread_kill(Thread, SIGTERM);
-	pthread_join(Thread, NULL);
+	pthread_kill(*Thread, SIGTERM);
+	pthread_join(*Thread, NULL);
 }
 
 #define maxval(a,b) ((a>b)?a:b)
--- a/drivers/unix/unix.c	Mon Feb 18 17:14:22 2008 +0100
+++ b/drivers/unix/unix.c	Tue Feb 19 14:52:40 2008 +0100
@@ -190,7 +190,7 @@
 	
 	int res = DLL_CALL(canClose)(tmp->fd);
 	
-	WaitReceiveTaskEnd(tmp->receiveTask);
+	WaitReceiveTaskEnd(&tmp->receiveTask);
 	return res;
 }
 
--- a/include/timers_driver.h	Mon Feb 18 17:14:22 2008 +0100
+++ b/include/timers_driver.h	Tue Feb 19 14:52:40 2008 +0100
@@ -30,7 +30,7 @@
 // For use from CAN driver
 void EnterMutex(void);
 void LeaveMutex(void);
-void WaitReceiveTaskEnd(TASK_HANDLE);
+void WaitReceiveTaskEnd(TASK_HANDLE*);
 
 // For use from application
 void StartTimerLoop(TimerCallback_t init_callback);