I am writing an application wherein I want call a function every 1 second. This is what I've written so far
Timerspec.it_interval.tv_sec=1;
Timerspec.it_interval.tv_nsec=0;
Timerspec.it_value.tv_sec=1;
Timerspec.it_value.tv_nsec=0;
timer_t timerId;
struct sigaction sa
sa.sa_handler=&TimerFn;
sigaction(SIGALRM,&sa,NULL);
timer_create(CLOCK_REALTIME,NULL,&timerId);
timer_settime(timerId,0,(const itimerspec*)Timerspec,NULL);
If my timer function(TimerFn) takes more than 1 second to complete, how to ignore the SIGALRM signals while the handler is running. Please note I want the signal to be ignored only when the handler is running. If handler is not running TimerFn should get called.
Thanks