PostgreSQL Source Code
git master
|
#include <signal.h>
Go to the source code of this file.
Macros | |
#define | PostmasterIsAlive() PostmasterIsAliveInternal() |
Typedefs | |
typedef struct PMSignalData | PMSignalData |
Functions | |
Size | PMSignalShmemSize (void) |
void | PMSignalShmemInit (void) |
void | SendPostmasterSignal (PMSignalReason reason) |
bool | CheckPostmasterSignal (PMSignalReason reason) |
void | SetQuitSignalReason (QuitSignalReason reason) |
QuitSignalReason | GetQuitSignalReason (void) |
int | AssignPostmasterChildSlot (void) |
bool | ReleasePostmasterChildSlot (int slot) |
bool | IsPostmasterChildWalSender (int slot) |
void | MarkPostmasterChildActive (void) |
void | MarkPostmasterChildInactive (void) |
void | MarkPostmasterChildWalSender (void) |
bool | PostmasterIsAliveInternal (void) |
void | PostmasterDeathSignalInit (void) |
#define PostmasterIsAlive | ( | ) | PostmasterIsAliveInternal() |
Definition at line 106 of file pmsignal.h.
typedef struct PMSignalData PMSignalData |
Definition at line 1 of file pmsignal.h.
enum PMSignalReason |
Definition at line 33 of file pmsignal.h.
enum QuitSignalReason |
Enumerator | |
---|---|
PMQUIT_NOT_SENT | |
PMQUIT_FOR_CRASH | |
PMQUIT_FOR_STOP |
Definition at line 50 of file pmsignal.h.
int AssignPostmasterChildSlot | ( | void | ) |
Definition at line 247 of file pmsignal.c.
References elog, FATAL, next_child_inuse, num_child_inuse, PM_CHILD_ASSIGNED, PMSignalData::PMChildFlags, PMChildInUse, and PMSignalState.
Referenced by assign_backendlist_entry(), BackendStartup(), and StartAutovacuumWorker().
bool CheckPostmasterSignal | ( | PMSignalReason | reason | ) |
Definition at line 198 of file pmsignal.c.
References PMSignalData::PMSignalFlags, and PMSignalState.
Referenced by process_pm_pmsignal().
QuitSignalReason GetQuitSignalReason | ( | void | ) |
Definition at line 229 of file pmsignal.c.
References IsUnderPostmaster, PMQUIT_NOT_SENT, PMSignalState, and PMSignalData::sigquit_reason.
Referenced by quickdie().
bool IsPostmasterChildWalSender | ( | int | slot | ) |
Definition at line 307 of file pmsignal.c.
References Assert, num_child_inuse, PM_CHILD_WALSENDER, PMSignalData::PMChildFlags, and PMSignalState.
Referenced by CountChildren(), and SignalSomeChildren().
void MarkPostmasterChildActive | ( | void | ) |
Definition at line 323 of file pmsignal.c.
References Assert, MyPMChildSlot, PM_CHILD_ACTIVE, PM_CHILD_ASSIGNED, PMSignalData::PMChildFlags, and PMSignalState.
Referenced by InitProcess().
void MarkPostmasterChildInactive | ( | void | ) |
Definition at line 356 of file pmsignal.c.
References Assert, MyPMChildSlot, PM_CHILD_ACTIVE, PM_CHILD_ASSIGNED, PM_CHILD_WALSENDER, PMSignalData::PMChildFlags, and PMSignalState.
Referenced by ProcKill().
void MarkPostmasterChildWalSender | ( | void | ) |
Definition at line 339 of file pmsignal.c.
References am_walsender, Assert, MyPMChildSlot, PM_CHILD_ACTIVE, PM_CHILD_WALSENDER, PMSignalData::PMChildFlags, and PMSignalState.
void PMSignalShmemInit | ( | void | ) |
Definition at line 144 of file pmsignal.c.
References MaxLivePostmasterChildren(), MemoryContextAllocZero(), MemSet, next_child_inuse, PMSignalData::num_child_flags, num_child_inuse, pfree(), PMChildInUse, PMSignalShmemSize(), PMSignalState, PostmasterContext, ShmemInitStruct(), and unvolatize.
Referenced by CreateOrAttachShmemStructs().
Size PMSignalShmemSize | ( | void | ) |
Definition at line 129 of file pmsignal.c.
References add_size(), MaxLivePostmasterChildren(), mul_size(), and size.
Referenced by CalculateShmemSize(), and PMSignalShmemInit().
void PostmasterDeathSignalInit | ( | void | ) |
Definition at line 437 of file pmsignal.c.
References elog, ERROR, and pqsignal().
Referenced by InitPostmasterChild().
bool PostmasterIsAliveInternal | ( | void | ) |
Definition at line 376 of file pmsignal.c.
References EAGAIN, elog, EWOULDBLOCK, FATAL, postmaster_alive_fds, POSTMASTER_FD_WATCH, and read.
Referenced by WaitEventSetWaitBlock().
bool ReleasePostmasterChildSlot | ( | int | slot | ) |
Definition at line 284 of file pmsignal.c.
References Assert, num_child_inuse, PM_CHILD_ASSIGNED, PM_CHILD_UNUSED, PMSignalData::PMChildFlags, PMChildInUse, and PMSignalState.
Referenced by BackendStartup(), CleanupBackend(), do_start_bgworker(), and StartAutovacuumWorker().
void SendPostmasterSignal | ( | PMSignalReason | reason | ) |
Definition at line 181 of file pmsignal.c.
References IsUnderPostmaster, kill, PMSignalData::PMSignalFlags, PMSignalState, PostmasterPid, and SIGUSR1.
Referenced by CheckRecoveryConsistency(), do_start_worker(), GetNewMultiXactId(), GetNewTransactionId(), PerformWalRecovery(), pg_rotate_logfile(), RegisterDynamicBackgroundWorker(), RequestXLogStreaming(), SetMultiXactIdLimit(), SetTransactionIdLimit(), and TerminateBackgroundWorker().
void SetQuitSignalReason | ( | QuitSignalReason | reason | ) |
Definition at line 218 of file pmsignal.c.
References PMSignalState, and PMSignalData::sigquit_reason.
Referenced by HandleChildCrash(), and process_pm_shutdown_request().