Schedule a SIGALRM delivery after the specified period in milliseconds. * If a timer is already scheduled, this function will re-schedule it to the * specified time. If period is 0 the current timer is disabled. */
| 2159 | * If a timer is already scheduled, this function will re-schedule it to the |
| 2160 | * specified time. If period is 0 the current timer is disabled. */ |
| 2161 | void watchdogScheduleSignal(int period) { |
| 2162 | struct itimerval it; |
| 2163 | |
| 2164 | /* Will stop the timer if period is 0. */ |
| 2165 | it.it_value.tv_sec = period/1000; |
| 2166 | it.it_value.tv_usec = (period%1000)*1000; |
| 2167 | /* Don't automatically restart. */ |
| 2168 | it.it_interval.tv_sec = 0; |
| 2169 | it.it_interval.tv_usec = 0; |
| 2170 | setitimer(ITIMER_REAL, &it, NULL); |
| 2171 | } |
| 2172 | |
| 2173 | /* Enable the software watchdog with the specified period in milliseconds. */ |
| 2174 | void enableWatchdog(int period) { |
no outgoing calls
no test coverage detected