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 333 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(), AuxiliaryProcessMain(), CheckpointerMain(), Exec_ListenPreCommit(), InitPostgres(), InitTemporaryFileAccess(), LoadArchiveLibrary(), LockGXact(), logicalrep_worker_attach(), MarkAsPreparing(), ParallelApplyWorkerMain(), ParallelWorkerMain(), pgstat_initialize(), register_persistent_abort_backup_handler(), and ReplicationSlotInitialize().
Size CalculateShmemSize | ( | int * | num_semaphores | ) |
Definition at line 86 of file ipci.c.
References add_size(), ApplyLauncherShmemSize(), AsyncShmemSize(), AutoVacuumShmemSize(), BackendStatusShmemSize(), BackgroundWorkerShmemSize(), BTreeShmemSize(), BufferShmemSize(), CheckpointerShmemSize(), CLOGShmemSize(), CommitTsShmemSize(), dsm_estimate_size(), hash_estimate_size(), LockShmemSize(), LWLockShmemSize(), MultiXactShmemSize(), PgArchShmemSize(), PGSemaphoreShmemSize(), PMSignalShmemSize(), PredicateLockShmemSize(), ProcArrayShmemSize(), ProcGlobalSemas(), ProcGlobalShmemSize(), ProcSignalShmemSize(), ReplicationOriginShmemSize(), ReplicationSlotsShmemSize(), SHMEM_INDEX_SIZE, SInvalShmemSize(), SpinlockSemas(), SpinlockSemaSize(), StatsShmemSize(), SUBTRANSShmemSize(), SyncScanShmemSize(), total_addin_request, TwoPhaseShmemSize(), WaitEventExtensionShmemSize(), WalRcvShmemSize(), WalSndShmemSize(), XLogPrefetchShmemSize(), XLogRecoveryShmemSize(), and XLOGShmemSize().
Referenced by CreateSharedMemoryAndSemaphores(), and InitializeShmemGUCs().
void cancel_before_shmem_exit | ( | pg_on_exit_callback | function, |
Datum | arg | ||
) |
Definition at line 390 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 428 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 175 of file ipci.c.
References ApplyLauncherShmemInit(), Assert(), AsyncShmemInit(), AutoVacuumShmemInit(), BackgroundWorkerShmemInit(), BTreeShmemInit(), CalculateShmemSize(), CheckpointerShmemInit(), CLOGShmemInit(), CommitTsShmemInit(), CreateLWLocks(), CreateSharedBackendStatus(), CreateSharedInvalidationState(), CreateSharedProcArray(), DEBUG3, dsm_postmaster_startup(), dsm_shmem_init(), elog(), GetConfigOption(), InitBufferPool(), InitLocks(), InitPredicateLocks(), InitProcGlobal(), InitShmemAccess(), InitShmemAllocation(), InitShmemIndex(), IsUnderPostmaster, MultiXactShmemInit(), PANIC, PgArchShmemInit(), PGReserveSemaphores(), PGSharedMemoryCreate(), PMSignalShmemInit(), ProcSignalShmemInit(), ReplicationOriginShmemInit(), ReplicationSlotsShmemInit(), shmem_startup_hook, SpinlockSemaInit(), StatsShmemInit(), SUBTRANSShmemInit(), SyncScanShmemInit(), TwoPhaseShmemInit(), WaitEventExtensionShmemInit(), WalRcvShmemInit(), WalSndShmemInit(), XLogPrefetchShmemInit(), XLogRecoveryShmemInit(), and XLOGShmemInit().
Referenced by BootstrapModeMain(), PostgresSingleUserMain(), PostmasterMain(), and PostmasterStateMachine().
void InitializeShmemGUCs | ( | void | ) |
Definition at line 333 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 412 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 305 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 361 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 autoprewarm_main(), AutoVacWorkerMain(), CreateAuxProcessResourceOwner(), dsm_postmaster_startup(), InitAuxiliaryProcess(), InitBufferPoolAccess(), InitProcess(), InitProcessPhase2(), InitWalSenderSlot(), InternalIpcMemoryCreate(), PgArchiverMain(), PGReserveSemaphores(), PGSharedMemoryCreate(), pgss_shmem_startup(), pgstat_beinit(), ProcSignalInit(), replorigin_session_setup(), SharedInvalBackendInit(), StartupProcessMain(), and WalReceiverMain().
void proc_exit | ( | int | code | ) |
Definition at line 104 of file ipc.c.
References DEBUG3, elog(), exit(), IsAutoVacuumWorkerProcess(), mkdir, proc_exit_prepare(), S_IRWXG, S_IRWXO, S_IRWXU, and snprintf.
Referenced by apply_worker_exit(), ApplyWorkerMain(), auth_failed(), AutoVacLauncherMain(), AutoVacWorkerMain(), AuxiliaryProcessMain(), BackendInitialize(), BootstrapModeMain(), CheckerModeMain(), DisableSubscriptionAndExit(), errfinish(), ExitPostmaster(), HandleCheckpointerInterrupts(), HandleMainLoopInterrupts(), HandlePgArchInterrupts(), HandleStartupProcInterrupts(), HandleWalWriterInterrupts(), InitializeLogRepWorker(), maybe_reread_subscription(), PerformWalRecovery(), pg_attribute_noreturn(), PgArchiverMain(), PostgresMain(), PostgresSingleUserMain(), PreRestoreCommand(), process_syncing_tables_for_apply(), ProcessInterrupts(), ProcessParallelApplyInterrupts(), ProcessRepliesIfAny(), ProcessStandbyMessage(), RestoreArchivedFile(), StartBackgroundWorker(), StartLogicalReplication(), StartReplication(), StartupProcessMain(), StartupProcShutdownHandler(), SysLoggerMain(), test_shm_mq_main(), WaitEventSetWaitBlock(), WalRcvWaitForStartPosition(), WalReceiverMain(), WalSndDone(), WalSndErrorCleanup(), and WalSndWait().
void shmem_exit | ( | int | code | ) |
Definition at line 224 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().