aboutsummaryrefslogtreecommitdiff
path: root/src/backend/storage/buffer/buf_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/storage/buffer/buf_init.c')
-rw-r--r--src/backend/storage/buffer/buf_init.c29
1 files changed, 5 insertions, 24 deletions
diff --git a/src/backend/storage/buffer/buf_init.c b/src/backend/storage/buffer/buf_init.c
index dd6478c195d..3d25381c14d 100644
--- a/src/backend/storage/buffer/buf_init.c
+++ b/src/backend/storage/buffer/buf_init.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/buffer/buf_init.c,v 1.52 2002/09/04 20:31:25 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/buffer/buf_init.c,v 1.53 2002/09/25 20:31:40 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -35,8 +35,6 @@
#include "utils/memutils.h"
-static void ShutdownBufferPoolAccess(void);
-
/*
* if BMTRACE is defined, we trace the last 200 buffer allocations and
* deallocations in a circular buffer in shared memory.
@@ -219,6 +217,10 @@ InitBufferPool(void)
* This is called during backend startup (whether standalone or under the
* postmaster). It sets up for this backend's access to the already-existing
* buffer pool.
+ *
+ * NB: this is called before InitProcess(), so we do not have a PGPROC and
+ * cannot do LWLockAcquire; hence we can't actually access the bufmgr's
+ * shared memory yet. We are only initializing local data here.
*/
void
InitBufferPoolAccess(void)
@@ -238,27 +240,6 @@ InitBufferPoolAccess(void)
*/
for (i = 0; i < NBuffers; i++)
BufferBlockPointers[i] = (Block) MAKE_PTR(BufferDescriptors[i].data);
-
- /*
- * Now that buffer access is initialized, set up a callback to shut it
- * down again at backend exit.
- */
- on_shmem_exit(ShutdownBufferPoolAccess, 0);
-}
-
-/*
- * Shut down buffer manager at backend exit.
- *
- * This is needed mainly to ensure that we don't leave any buffer reference
- * counts set during an error exit.
- */
-static void
-ShutdownBufferPoolAccess(void)
-{
- /* Release any buffer context locks we are holding */
- UnlockBuffers();
- /* Release any buffer reference counts we are holding */
- AtEOXact_Buffers(false);
}
/* -----------------------------------------------------