create specific timer thread for UCLIBC support (with CLOCK_PROCESS_CPUTIME_ID parameter)
authorgreg
Mon, 12 Oct 2009 14:19:27 +0200
changeset 607 5fec528f66cf
parent 606 15a175f6305d
child 608 daa1e1c3fba4
create specific timer thread for UCLIBC support (with CLOCK_PROCESS_CPUTIME_ID parameter)
drivers/timers_unix/timers_unix.c
--- a/drivers/timers_unix/timers_unix.c	Thu Oct 08 17:34:44 2009 +0200
+++ b/drivers/timers_unix/timers_unix.c	Mon Oct 12 14:19:27 2009 +0200
@@ -48,6 +48,11 @@
 	// Take first absolute time ref.
 	gettimeofday(&last_sig,NULL);
 
+#if defined(__UCLIBC__)
+	int ret;
+	ret = timer_create(CLOCK_PROCESS_CPUTIME_ID, NULL, &timer);
+	signal(SIGALRM, timer_notify);
+#else
 	memset (&sigev, 0, sizeof (struct sigevent));
 	sigev.sigev_value.sival_int = 0;
 	sigev.sigev_notify = SIGEV_THREAD;
@@ -55,6 +60,7 @@
 	sigev.sigev_notify_function = timer_notify;
 
 	timer_create (CLOCK_REALTIME, &sigev, &timer);
+#endif
 }
 
 void StopTimerLoop(TimerCallback_t exitfunction)