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

Function enable_timeout_at

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

* Enable the specified timeout to fire at the specified time. * * This is provided to support cases where there's a reason to calculate * the timeout by reference to some point other than "now". If there isn't, * use enable_timeout_after(), to avoid calling GetCurrentTimestamp() twice. */

Source from the content-addressed store, hash-verified

559 * use enable_timeout_after(), to avoid calling GetCurrentTimestamp() twice.
560 */
561void
562enable_timeout_at(TimeoutId id, TimestampTz fin_time)
563{
564 TimestampTz now;
565
566 /* Disable timeout interrupts for safety. */
567 disable_alarm();
568
569 /* Queue the timeout at the appropriate time. */
570 now = GetCurrentTimestamp();
571 enable_timeout(id, now, fin_time);
572
573 /* Set the timer interrupt. */
574 schedule_alarm(now);
575}
576
577/*
578 * Enable multiple timeouts at once.

Callers

nothing calls this directly

Calls 3

GetCurrentTimestampFunction · 0.85
enable_timeoutFunction · 0.85
schedule_alarmFunction · 0.85

Tested by

no test coverage detected