MCPcopy Create free account
hub / github.com/F-Stack/f-stack / watchdogScheduleSignal

Function watchdogScheduleSignal

app/redis-6.2.6/src/debug.c:1931–1941  ·  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

1929 * If a timer is already scheduled, this function will re-schedule it to the
1930 * specified time. If period is 0 the current timer is disabled. */
1931void watchdogScheduleSignal(int period) {
1932 struct itimerval it;
1933
1934 /* Will stop the timer if period is 0. */
1935 it.it_value.tv_sec = period/1000;
1936 it.it_value.tv_usec = (period%1000)*1000;
1937 /* Don't automatically restart. */
1938 it.it_interval.tv_sec = 0;
1939 it.it_interval.tv_usec = 0;
1940 setitimer(ITIMER_REAL, &it, NULL);
1941}
1942
1943/* Enable the software watchdog with the specified period in milliseconds. */
1944void enableWatchdog(int period) {

Callers 3

serverCronFunction · 0.85
enableWatchdogFunction · 0.85
disableWatchdogFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected