MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / watchdogScheduleSignal

Function watchdogScheduleSignal

src/debug.cpp:2161–2171  ·  view source on GitHub ↗

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. */

Source from the content-addressed store, hash-verified

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. */
2161void 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. */
2174void enableWatchdog(int period) {

Callers 3

serverCronFunction · 0.85
enableWatchdogFunction · 0.85
disableWatchdogFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected