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

Function disable_timeout

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

* Cancel the specified timeout. * * The timeout's I've-been-fired indicator is reset, * unless keep_indicator is true. * * When a timeout is canceled, any other active timeout remains in force. * It's not an error to disable a timeout that is not enabled. */

Source from the content-addressed store, hash-verified

631 * It's not an error to disable a timeout that is not enabled.
632 */
633void
634disable_timeout(TimeoutId id, bool keep_indicator)
635{
636 /* Assert request is sane */
637 Assert(all_timeouts_initialized);
638 Assert(all_timeouts[id].timeout_handler != NULL);
639
640 /* Disable timeout interrupts for safety. */
641 disable_alarm();
642
643 /* Find the timeout and remove it from the active list. */
644 if (all_timeouts[id].active)
645 remove_timeout_index(find_active_timeout(id));
646
647 /* Mark it inactive, whether it was active or not. */
648 if (!keep_indicator)
649 all_timeouts[id].indicator = false;
650
651 /* Reschedule the interrupt, if any timeouts remain active. */
652 if (num_active_timeouts > 0)
653 schedule_alarm(GetCurrentTimestamp());
654}
655
656/*
657 * Cancel multiple timeouts at once.

Callers 9

PostgresMainFunction · 0.85
enable_statement_timeoutFunction · 0.85
PerformAuthenticationFunction · 0.85
CronBackgroundWorkerFunction · 0.85
ProcSleepFunction · 0.85
ResProcSleepFunction · 0.85
BackendInitializeFunction · 0.85

Calls 4

remove_timeout_indexFunction · 0.85
find_active_timeoutFunction · 0.85
schedule_alarmFunction · 0.85
GetCurrentTimestampFunction · 0.85

Tested by

no test coverage detected