title: Signal Handler in a separate pthread using timer_create
body: <p>I am developing a small application where in I want to call a function every 1 second. This is how I implemented</p>
  
  <pre><code>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=&amp;TimerFn;
  sa.sa_flags=0;
  sigemptyset(&amp;sa.sa_mask);
  sigaction(SIGALRM,&amp;sa,NULL);
  
  timer_create(CLOCK_REALTIME,NULL,&amp;timerId);
  timer_settime(timerId,0,(const itimerspec*)Timerspec,NULL);
  </code></pre>
  
  <p>But I want to run the <strong>TimerFn</strong> function in a separate pthread(basically a timer for pthread function). Can somebody please tell how to do this?</p>