I created setitimer in loop for create timer for every interval.After long running that is automaticaly going out of the loop.
int timeOutSec = ZERO;
int timeOutMsec = ZERO;
int timerResult = ZERO;
struct sigaction sigact;
struct itimerval timerval;
// Assign the signal handler method.
sigemptyset(&sigact.sa_mask);
sigact.sa_flags = ZERO;
sigact.sa_handler = SignalHandler;
sigaction(SIGALRM, &sigact, NULL);
while(ONE) {
// Set the timer.
timerResult = setitimer(ITIMER_REAL, &timerval, NULL);
pause();
cout<<"timerResult="<<timerResult<<endl;
}
It is running long time after that suddenly comming out without showing any error.inputs whatever i am giving are correct.timerResult also ZERO value every time.Please help on this.
// Get the instance of the helper object.
StatHelper_i *helperObjRef = StatHelper_i::getHelperInstance();
// Set the timer flag to true.
helperObjRef->GetTimerFlag() = true;
}// End of SignalHandler method.
this is my signal handler.i am just setting one flag on that.Here also i am getting correct signal.After long time control is not comming to this handler.
timerResult also not printing after that.I think control is going out from while(ONE).
Please tell me one solution because this loop should work whole time.
After giving 5 millisecond i am getting this issue fast.