aboutsummaryrefslogtreecommitdiff
path: root/src/backend/storage/lmgr/proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/storage/lmgr/proc.c')
-rw-r--r--src/backend/storage/lmgr/proc.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c
index 6648c6e5e7e..b6451d9d083 100644
--- a/src/backend/storage/lmgr/proc.c
+++ b/src/backend/storage/lmgr/proc.c
@@ -291,7 +291,7 @@ InitProcGlobal(void)
}
/*
- * InitProcess -- initialize a per-process data structure for this backend
+ * InitProcess -- initialize a per-process PGPROC entry for this backend
*/
void
InitProcess(void)
@@ -461,6 +461,16 @@ InitProcess(void)
*/
InitLWLockAccess();
InitDeadLockChecking();
+
+#ifdef EXEC_BACKEND
+
+ /*
+ * Initialize backend-local pointers to all the shared data structures.
+ * (We couldn't do this until now because it needs LWLocks.)
+ */
+ if (IsUnderPostmaster)
+ AttachSharedMemoryStructs();
+#endif
}
/*
@@ -487,7 +497,7 @@ InitProcessPhase2(void)
}
/*
- * InitAuxiliaryProcess -- create a per-auxiliary-process data structure
+ * InitAuxiliaryProcess -- create a PGPROC entry for an auxiliary process
*
* This is called by bgwriter and similar processes so that they will have a
* MyProc value that's real enough to let them wait for LWLocks. The PGPROC
@@ -621,6 +631,16 @@ InitAuxiliaryProcess(void)
* acquired in aux processes.)
*/
InitLWLockAccess();
+
+#ifdef EXEC_BACKEND
+
+ /*
+ * Initialize backend-local pointers to all the shared data structures.
+ * (We couldn't do this until now because it needs LWLocks.)
+ */
+ if (IsUnderPostmaster)
+ AttachSharedMemoryStructs();
+#endif
}
/*