How to pause/continue itimer ?

Beesdeckar <[email protected]>
Newsgroups gmane.os.netbsd.devel.kernel
Organization Soft in Engines
Message-ID <[email protected]>
Hello,

I have functional timer calling handler in 1 second intervals.

Initialization:

my_itimer_ops.TimerOps.ito_fire = MyTimerHandler;
my_itimer_ops.ito_realtime_changed = NULL;
itimer_init(&my_itimer, &my_itimer_ops, CLOCK_REALTIME, NULL);

Starting timer period in miliseconds:

getnanotime(&my_itimer.it_time.it_value);
my_itimer.it_time.it_interval.tv_sec = period / 1000;
my_itimer.it_time.it_interval.tv_nsec = (period % 1000) * 1000000;
itimer_settime(&my_itimer);

Then MyTimerHandler is called every second.
I need to pause it for some seconds and start again.

when I try:
itimer_poison(&my_itimer);
and use above starting sequence of code then MyTimerHandler is called 
only once and stops.

I also tried to release timer resources with:

itimer_fini(&my_itimer);
and after it I use above Initialization and Starting then
something is system stays damaged, tail -f /var/log/messages is slow
entering console command is slow and I need to restart OS.

My question are:
Does exist any way how to pause itimer and after some time start it again ?
Or can be struct itimer reused for next itimer initialization and 
starting at all ?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.