Server IP : 85.214.239.14 / Your IP : 18.118.19.89 Web Server : Apache/2.4.62 (Debian) System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.18 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /proc/2/task/2/root/proc/2/cwd/usr/include/postgresql/9.6/server/utils/ |
Upload File : |
/*------------------------------------------------------------------------- * * timeout.h * Routines to multiplex SIGALRM interrupts for multiple timeout reasons. * * * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/timeout.h * *------------------------------------------------------------------------- */ #ifndef TIMEOUT_H #define TIMEOUT_H #include "datatype/timestamp.h" /* * Identifiers for timeout reasons. Note that in case multiple timeouts * trigger at the same time, they are serviced in the order of this enum. */ typedef enum TimeoutId { /* Predefined timeout reasons */ STARTUP_PACKET_TIMEOUT, DEADLOCK_TIMEOUT, LOCK_TIMEOUT, STATEMENT_TIMEOUT, STANDBY_DEADLOCK_TIMEOUT, STANDBY_TIMEOUT, STANDBY_LOCK_TIMEOUT, IDLE_IN_TRANSACTION_SESSION_TIMEOUT, /* First user-definable timeout reason */ USER_TIMEOUT, /* Maximum number of timeout reasons */ MAX_TIMEOUTS = 16 } TimeoutId; /* callback function signature */ typedef void (*timeout_handler_proc) (void); /* * Parameter structure for setting multiple timeouts at once */ typedef enum TimeoutType { TMPARAM_AFTER, TMPARAM_AT } TimeoutType; typedef struct { TimeoutId id; /* timeout to set */ TimeoutType type; /* TMPARAM_AFTER or TMPARAM_AT */ int delay_ms; /* only used for TMPARAM_AFTER */ TimestampTz fin_time; /* only used for TMPARAM_AT */ } EnableTimeoutParams; /* * Parameter structure for clearing multiple timeouts at once */ typedef struct { TimeoutId id; /* timeout to clear */ bool keep_indicator; /* keep the indicator flag? */ } DisableTimeoutParams; /* timeout setup */ extern void InitializeTimeouts(void); extern TimeoutId RegisterTimeout(TimeoutId id, timeout_handler_proc handler); extern void reschedule_timeouts(void); /* timeout operation */ extern void enable_timeout_after(TimeoutId id, int delay_ms); extern void enable_timeout_at(TimeoutId id, TimestampTz fin_time); extern void enable_timeouts(const EnableTimeoutParams *timeouts, int count); extern void disable_timeout(TimeoutId id, bool keep_indicator); extern void disable_timeouts(const DisableTimeoutParams *timeouts, int count); extern void disable_all_timeouts(bool keep_indicators); /* accessors */ extern bool get_timeout_indicator(TimeoutId id, bool reset_indicator); extern TimestampTz get_timeout_start_time(TimeoutId id); extern TimestampTz get_timeout_finish_time(TimeoutId id); #endif /* TIMEOUT_H */