PostgreSQL Source Code
git master
|
Go to the source code of this file.
Macros | |
#define | PG_ENSURE_ERROR_CLEANUP(cleanup_function, arg) |
#define | PG_END_ENSURE_ERROR_CLEANUP(cleanup_function, arg) |
Typedefs | |
typedef void(* | pg_on_exit_callback) (int code, Datum arg) |
typedef void(* | shmem_startup_hook_type) (void) |
Functions | |
void | proc_exit (int code) pg_attribute_noreturn() |
void | shmem_exit (int code) |
void | on_proc_exit (pg_on_exit_callback function, Datum arg) |
void | on_shmem_exit (pg_on_exit_callback function, Datum arg) |
void | before_shmem_exit (pg_on_exit_callback function, Datum arg) |
void | cancel_before_shmem_exit (pg_on_exit_callback function, Datum arg) |
void | on_exit_reset (void) |
void | check_on_shmem_exit_lists_are_empty (void) |
Size | CalculateShmemSize (int *num_semaphores) |
void | CreateSharedMemoryAndSemaphores (void) |
void | InitializeShmemGUCs (void) |
Variables | |
PGDLLIMPORT bool | proc_exit_inprogress |
PGDLLIMPORT bool | shmem_exit_inprogress |
PGDLLIMPORT shmem_startup_hook_type | shmem_startup_hook |
#define PG_END_ENSURE_ERROR_CLEANUP | ( | cleanup_function, | |
arg | |||
) |
#define PG_ENSURE_ERROR_CLEANUP | ( | cleanup_function, | |
arg | |||
) |
void before_shmem_exit | ( | pg_on_exit_callback | function, |
Datum | arg | ||
) |
Definition at line 337 of file ipc.c.
References ONEXIT::arg, arg, atexit_callback(), atexit_callback_setup, before_shmem_exit_index, before_shmem_exit_list, ereport, errcode(), errmsg_internal(), FATAL, ONEXIT::function, and MAX_ON_EXITS.
Referenced by ApplyLauncherMain(), AtEOXact_Namespace(), autoprewarm_main(), AuxiliaryProcessMainCommon(), CheckpointerMain(), Exec_ListenPreCommit(), InitPostgres(), InitTemporaryFileAccess(), injection_points_set_local(), LoadArchiveLibrary(), LockGXact(), logicalrep_worker_attach(), MarkAsPreparing(), ParallelApplyWorkerMain(), ParallelWorkerMain(), pgstat_initialize(), register_persistent_abort_backup_handler(), ReplicationSlotInitialize(), ReplSlotSyncWorkerMain(), and SetupApplyOrSyncWorker().
Size CalculateShmemSize | ( | int * | num_semaphores | ) |
Definition at line 88 of file ipci.c.
References add_size(), ApplyLauncherShmemSize(), AsyncShmemSize(), AutoVacuumShmemSize(), BackendStatusShmemSize(), BackgroundWorkerShmemSize(), BTreeShmemSize(), BufferManagerShmemSize(), CheckpointerShmemSize(), CLOGShmemSize(), CommitTsShmemSize(), dsm_estimate_size(), DSMRegistryShmemSize(), hash_estimate_size(), InjectionPointShmemSize(), LockManagerShmemSize(), LWLockShmemSize(), MultiXactShmemSize(), PgArchShmemSize(), PGSemaphoreShmemSize(), PMSignalShmemSize(), PredicateLockShmemSize(), ProcArrayShmemSize(), ProcGlobalSemas(), ProcGlobalShmemSize(), ProcSignalShmemSize(), ReplicationOriginShmemSize(), ReplicationSlotsShmemSize(), SharedInvalShmemSize(), SHMEM_INDEX_SIZE, size, SlotSyncShmemSize(), StatsShmemSize(), SUBTRANSShmemSize(), SyncScanShmemSize(), total_addin_request, TwoPhaseShmemSize(), VarsupShmemSize(), WaitEventCustomShmemSize(), WalRcvShmemSize(), WalSndShmemSize(), WalSummarizerShmemSize(), XLogPrefetchShmemSize(), XLogRecoveryShmemSize(), and XLOGShmemSize().
Referenced by CreateSharedMemoryAndSemaphores(), and InitializeShmemGUCs().
void cancel_before_shmem_exit | ( | pg_on_exit_callback | function, |
Datum | arg | ||
) |
Definition at line 394 of file ipc.c.
References arg, before_shmem_exit_index, before_shmem_exit_list, elog, and ERROR.
void check_on_shmem_exit_lists_are_empty | ( | void | ) |
Definition at line 432 of file ipc.c.
References before_shmem_exit_index, elog, FATAL, and on_shmem_exit_index.
Referenced by BackendInitialize().
void CreateSharedMemoryAndSemaphores | ( | void | ) |
Definition at line 198 of file ipci.c.
References Assert, CalculateShmemSize(), CreateOrAttachShmemStructs(), DEBUG3, dsm_postmaster_startup(), elog, GetConfigOption(), InitShmemAccess(), InitShmemAllocation(), IsUnderPostmaster, PGReserveSemaphores(), PGSharedMemoryCreate(), shmem_startup_hook, and size.
Referenced by BootstrapModeMain(), PostgresSingleUserMain(), PostmasterMain(), and PostmasterStateMachine().
void InitializeShmemGUCs | ( | void | ) |
Definition at line 352 of file ipci.c.
References add_size(), buf, CalculateShmemSize(), GetHugePageSize(), PGC_INTERNAL, PGC_S_DYNAMIC_DEFAULT, SetConfigOption(), and sprintf.
Referenced by PostgresSingleUserMain(), and PostmasterMain().
void on_exit_reset | ( | void | ) |
Definition at line 416 of file ipc.c.
References before_shmem_exit_index, on_proc_exit_index, on_shmem_exit_index, and reset_on_dsm_detach().
Referenced by InitPostmasterChild().
void on_proc_exit | ( | pg_on_exit_callback | function, |
Datum | arg | ||
) |
Definition at line 309 of file ipc.c.
References ONEXIT::arg, arg, atexit_callback(), atexit_callback_setup, ereport, errcode(), errmsg_internal(), FATAL, ONEXIT::function, MAX_ON_EXITS, on_proc_exit_index, and on_proc_exit_list.
Referenced by CreateLockFile(), InitCatCache(), llvm_session_initialize(), PostgresMain(), PostmasterMain(), pq_init(), select_perl_context(), sepgsql_avc_init(), and smgrinit().
void on_shmem_exit | ( | pg_on_exit_callback | function, |
Datum | arg | ||
) |
Definition at line 365 of file ipc.c.
References ONEXIT::arg, arg, atexit_callback(), atexit_callback_setup, ereport, errcode(), errmsg_internal(), FATAL, ONEXIT::function, MAX_ON_EXITS, on_shmem_exit_index, and on_shmem_exit_list.
Referenced by AutoVacWorkerMain(), CreateAuxProcessResourceOwner(), dsm_postmaster_startup(), InitAuxiliaryProcess(), InitBufferManagerAccess(), InitProcess(), InitProcessPhase2(), InitWalSenderSlot(), InternalIpcMemoryCreate(), PgArchiverMain(), PGReserveSemaphores(), PGSharedMemoryCreate(), pgss_shmem_startup(), pgstat_beinit(), ProcSignalInit(), RegisterPostmasterChildActive(), replorigin_session_setup(), SharedInvalBackendInit(), StartupProcessMain(), WalReceiverMain(), and WalSummarizerMain().
void proc_exit | ( | int | code | ) |
Definition at line 104 of file ipc.c.
References AmAutoVacuumWorkerProcess, DEBUG3, elog, exit(), mkdir, MyProcPid, PANIC, proc_exit_prepare(), S_IRWXG, S_IRWXO, S_IRWXU, and snprintf.
Referenced by apply_worker_exit(), ApplyWorkerMain(), auth_failed(), AutoVacWorkerMain(), BackendInitialize(), BackgroundWorkerMain(), BootstrapModeMain(), CheckerModeMain(), DisableSubscriptionAndExit(), errfinish(), ExitPostmaster(), HandleCheckpointerInterrupts(), HandleMainLoopInterrupts(), HandlePgArchInterrupts(), HandleStartupProcInterrupts(), HandleWalSummarizerInterrupts(), InitializeLogRepWorker(), maybe_reread_subscription(), PerformWalRecovery(), pg_attribute_noreturn(), PgArchiverMain(), PostgresMain(), PostgresSingleUserMain(), PreRestoreCommand(), process_syncing_tables_for_apply(), ProcessInterrupts(), ProcessParallelApplyInterrupts(), ProcessRepliesIfAny(), ProcessSlotSyncInterrupts(), ProcessStandbyMessage(), ReplSlotSyncWorkerMain(), RestoreArchivedFile(), slotsync_reread_config(), StartLogicalReplication(), StartReplication(), StartupProcessMain(), StartupProcShutdownHandler(), SysLoggerMain(), test_shm_mq_main(), WaitEventSetWaitBlock(), WalRcvWaitForStartPosition(), WalReceiverMain(), WalSndDone(), WalSndErrorCleanup(), WalSndWait(), and WalSummarizerMain().
void shmem_exit | ( | int | code | ) |
Definition at line 228 of file ipc.c.
References arg, before_shmem_exit_index, before_shmem_exit_list, DEBUG3, dsm_backend_shutdown(), elog, ONEXIT::function, on_shmem_exit_index, on_shmem_exit_list, and shmem_exit_inprogress.
Referenced by PostmasterStateMachine(), and proc_exit_prepare().
|
extern |
Definition at line 40 of file ipc.c.
Referenced by die(), errstart(), llvm_release_context(), llvm_shutdown(), proc_exit_prepare(), ProcessRecoveryConflictInterrupts(), and StatementCancelHandler().
|
extern |
Definition at line 45 of file ipc.c.
Referenced by AtAbort_Portals(), and shmem_exit().
|
extern |
Definition at line 57 of file ipci.c.
Referenced by _PG_init(), and CreateSharedMemoryAndSemaphores().