Timer not firing at the set time

Hi,

I want the timer to fire say after 5 min and below is the code which I have
implemented,but
I found that timer never fires at the set time,Can anyone correct me,where I
am making mistake.

rgds,
Mankan

{
struct itimerspec itime;
struct sigevent event;


event.sigev_notify = SIGEV_INTR;

timer_create(CLOCK_REALTIME, &event, &timer_id);

itime.it_value.tv_sec = 300;
itime.it_value.tv_nsec = 0;

itime.it_interval.tv_sec = 300;
itime.it_interval.tv_nsec = 0;

timer_settime(timer_id,0,&itime,NULL);

}

Mankan <smankan@nospam.ueidaq.com> wrote:

Hi,

I want the timer to fire say after 5 min and below is the code which I have
implemented,but
I found that timer never fires at the set time,Can anyone correct me,where I
am making mistake.

rgds,
Mankan

{
struct itimerspec itime;
struct sigevent event;



event.sigev_notify = SIGEV_INTR;

Notification type SIGEV_INTR is only available (valid) for use
between an interrupt handler and the thread that attached it.

Try using a notification type of SIGEV_SIGNAL or SIGEV_PULSE.

If you are trying to unblock an InterruptWait() call after a certain
time even if you’ve gotten no interrupts, try using a TimerTimeout().

-David

timer_create(CLOCK_REALTIME, &event, &timer_id);

itime.it_value.tv_sec = 300;
itime.it_value.tv_nsec = 0;

itime.it_interval.tv_sec = 300;
itime.it_interval.tv_nsec = 0;

timer_settime(timer_id,0,&itime,NULL);

}


QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.