diff --git a/src/backend/utils/init/globals.c b/src/backend/utils/init/globals.c index c6939779b9..5ed715589e 100644 --- a/src/backend/utils/init/globals.c +++ b/src/backend/utils/init/globals.c @@ -27,12 +27,35 @@ ProtocolVersion FrontendProtocol; +/* + * Signal Handling variables here are set in signal handlers and can be + * checked by code to determine the implications of calling + * CHECK_FOR_INTERRUPTS(). While all are supported, in practice + * InterruptPending, QueryCancelPending, and ProcDiePending appear to be + * sufficient for almost all use cases. + */ + +/* Whether CHECK_FOR_INTERRUPTS will do anything */ volatile sig_atomic_t InterruptPending = false; + +/* Whether we are planning on cancelling the current query */ volatile sig_atomic_t QueryCancelPending = false; + +/* Whether we are planning to exit the current process when safe to do so.*/ volatile sig_atomic_t ProcDiePending = false; + +/* Whether we have detected a lost client connection */ volatile sig_atomic_t ClientConnectionLost = false; + +/* + * Whether the process is dying because idle transaction timeout has been + * reached. + */ volatile sig_atomic_t IdleInTransactionSessionTimeoutPending = false; + +/* Whether we will reload the configuration at next opportunity */ volatile sig_atomic_t ConfigReloadPending = false; + volatile uint32 InterruptHoldoffCount = 0; volatile uint32 QueryCancelHoldoffCount = 0; volatile uint32 CritSectionCount = 0;