MCPcopy Create free account
hub / github.com/apache/cloudberry / InitProcessPhase2

Function InitProcessPhase2

src/backend/storage/lmgr/proc.c:635–649  ·  view source on GitHub ↗

* InitProcessPhase2 -- make MyProc visible in the shared ProcArray. * * This is separate from InitProcess because we can't acquire LWLocks until * we've created a PGPROC, but in the EXEC_BACKEND case ProcArrayAdd won't * work until after we've done CreateSharedMemoryAndSemaphores. */

Source from the content-addressed store, hash-verified

633 * work until after we've done CreateSharedMemoryAndSemaphores.
634 */
635void
636InitProcessPhase2(void)
637{
638 Assert(MyProc != NULL);
639
640 /*
641 * Add our PGPROC to the PGPROC array in shared memory.
642 */
643 ProcArrayAdd(MyProc);
644
645 /*
646 * Arrange to clean that up at backend exit.
647 */
648 on_shmem_exit(RemoveProcFromArray, 0);
649}
650
651/*
652 * InitAuxiliaryProcess -- create a per-auxiliary-process data structure

Callers 2

InitPostgresFunction · 0.85

Calls 2

ProcArrayAddFunction · 0.85
on_shmem_exitFunction · 0.85

Tested by

no test coverage detected