MCPcopy Create free account
hub / github.com/apache/cloudberry / InitializeTimeouts

Function InitializeTimeouts

src/backend/utils/misc/timeout.c:447–471  ·  view source on GitHub ↗

* Initialize timeout module. * * This must be called in every process that wants to use timeouts. * * If the process was forked from another one that was also using this * module, be sure to call this before re-enabling signals; else handlers * meant to run in the parent process might get invoked in this one. */

Source from the content-addressed store, hash-verified

445 * meant to run in the parent process might get invoked in this one.
446 */
447void
448InitializeTimeouts(void)
449{
450 int i;
451
452 /* Initialize, or re-initialize, all local state */
453 disable_alarm();
454
455 num_active_timeouts = 0;
456
457 for (i = 0; i < MAX_TIMEOUTS; i++)
458 {
459 all_timeouts[i].index = i;
460 all_timeouts[i].active = false;
461 all_timeouts[i].indicator = false;
462 all_timeouts[i].timeout_handler = NULL;
463 all_timeouts[i].start_time = 0;
464 all_timeouts[i].fin_time = 0;
465 }
466
467 all_timeouts_initialized = true;
468
469 /* Now establish the signal handler */
470 pqsignal(SIGALRM, handle_sig_alarm);
471}
472
473/*
474 * Register a timeout reason

Callers 9

PostgresMainFunction · 0.85
WalSndSignalsFunction · 0.85
StartupProcessMainFunction · 0.85
StartBackgroundWorkerFunction · 0.85
LoginMonitorLauncherMainFunction · 0.85
LoginMonitorWorkerMainFunction · 0.85
BackendInitializeFunction · 0.85
AutoVacLauncherMainFunction · 0.85
AutoVacWorkerMainFunction · 0.85

Calls 1

pqsignalFunction · 0.50

Tested by

no test coverage detected