46 struct sigevent sigev; |
46 struct sigevent sigev; |
47 |
47 |
48 // Take first absolute time ref. |
48 // Take first absolute time ref. |
49 gettimeofday(&last_sig,NULL); |
49 gettimeofday(&last_sig,NULL); |
50 |
50 |
|
51 #if defined(__UCLIBC__) |
|
52 int ret; |
|
53 ret = timer_create(CLOCK_PROCESS_CPUTIME_ID, NULL, &timer); |
|
54 signal(SIGALRM, timer_notify); |
|
55 #else |
51 memset (&sigev, 0, sizeof (struct sigevent)); |
56 memset (&sigev, 0, sizeof (struct sigevent)); |
52 sigev.sigev_value.sival_int = 0; |
57 sigev.sigev_value.sival_int = 0; |
53 sigev.sigev_notify = SIGEV_THREAD; |
58 sigev.sigev_notify = SIGEV_THREAD; |
54 sigev.sigev_notify_attributes = NULL; |
59 sigev.sigev_notify_attributes = NULL; |
55 sigev.sigev_notify_function = timer_notify; |
60 sigev.sigev_notify_function = timer_notify; |
56 |
61 |
57 timer_create (CLOCK_REALTIME, &sigev, &timer); |
62 timer_create (CLOCK_REALTIME, &sigev, &timer); |
|
63 #endif |
58 } |
64 } |
59 |
65 |
60 void StopTimerLoop(TimerCallback_t exitfunction) |
66 void StopTimerLoop(TimerCallback_t exitfunction) |
61 { |
67 { |
62 EnterMutex(); |
68 EnterMutex(); |