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

Function disableWatchdog

src/debug.cpp:2197–2209  ·  view source on GitHub ↗

Disable the software watchdog. */

Source from the content-addressed store, hash-verified

2195
2196/* Disable the software watchdog. */
2197void disableWatchdog(void) {
2198 struct sigaction act;
2199 if (g_pserver->watchdog_period == 0) return; /* Already disabled. */
2200 watchdogScheduleSignal(0); /* Stop the current timer. */
2201
2202 /* Set the signal handler to SIG_IGN, this will also remove pending
2203 * signals from the queue. */
2204 sigemptyset(&act.sa_mask);
2205 act.sa_flags = 0;
2206 act.sa_handler = SIG_IGN;
2207 sigaction(SIGALRM, &act, NULL);
2208 g_pserver->watchdog_period = 0;
2209}
2210
2211/* Positive input is sleep time in microseconds. Negative input is fractions
2212 * of microseconds, i.e. -10 means 100 nanoseconds. */

Callers 1

configSetCommandFunction · 0.85

Calls 2

watchdogScheduleSignalFunction · 0.85
sigactionClass · 0.70

Tested by

no test coverage detected