summaryrefslogtreecommitdiff
path: root/src/backend/storage/lmgr/proc.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2001-11-06 00:38:26 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2001-11-06 00:38:26 +0000
commitca7578d45477ee0cb33bdb62c863acfe098347b3 (patch)
treeacf1e38e42a8913df95b8c418e88085b6f4a3bbe /src/backend/storage/lmgr/proc.c
parent0053cebea5f3803e853accafb1810afd8cb02b0e (diff)
The extra semaphore that proc.c now allocates for checkpoint processes
should be accounted for in the PROC_SEM_MAP_ENTRIES() macro. Otherwise the ports that rely on this macro to size data structures are broken. Mea culpa.
Diffstat (limited to 'src/backend/storage/lmgr/proc.c')
-rw-r--r--src/backend/storage/lmgr/proc.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c
index 1b0058eaeff..84118c78d37 100644
--- a/src/backend/storage/lmgr/proc.c
+++ b/src/backend/storage/lmgr/proc.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.114 2001/10/28 06:25:50 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.115 2001/11/06 00:38:26 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -124,10 +124,13 @@ InitProcGlobal(int maxBackends)
/*
* Compute size for ProcGlobal structure. Note we need one more sema
- * besides those used for regular backends.
+ * besides those used for regular backends; this is accounted for in
+ * the PROC_SEM_MAP_ENTRIES macro. (We do it that way so that other
+ * modules that use PROC_SEM_MAP_ENTRIES(maxBackends) to size data
+ * structures don't have to know about this explicitly.)
*/
Assert(maxBackends > 0);
- semMapEntries = PROC_SEM_MAP_ENTRIES(maxBackends + 1);
+ semMapEntries = PROC_SEM_MAP_ENTRIES(maxBackends);
procGlobalSize = sizeof(PROC_HDR) + (semMapEntries - 1) *sizeof(SEM_MAP_ENTRY);
/* Create or attach to the ProcGlobal shared structure */