* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.120.2.2 2002/09/30 19:55:08 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.120.2.3 2002/09/30 20:18:59 tgl Exp $
*
*-------------------------------------------------------------------------
*/
BaseInit();
+ if (IsUnderPostmaster)
+ InitDummyProcess(); /* needed to get LWLocks */
+
/*
* XLOG operations
*/
break;
case BS_XLOG_CHECKPOINT:
- if (IsUnderPostmaster)
- InitDummyProcess(); /* needed to get LWLocks */
CreateDummyCaches();
CreateCheckPoint(false, false);
SetSavedRedoRecPtr(); /* pass redo ptr back to postmaster */
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/buffer/buf_init.c,v 1.47 2001/11/05 17:46:27 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/buffer/buf_init.c,v 1.47.2.1 2002/09/30 20:18:59 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#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.
*/
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 */
- ResetBufferPool(false);
}
/* -----------------------------------------------------
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lwlock.c,v 1.8 2002/01/07 16:33:00 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lwlock.c,v 1.8.2.1 2002/09/30 20:18:59 tgl Exp $
*
*-------------------------------------------------------------------------
*/
PRINT_LWDEBUG("LWLockAcquire", lockid, lock);
+ /*
+ * We can't wait if we haven't got a PROC. This should only occur
+ * during bootstrap or shared memory initialization. Put an Assert
+ * here to catch unsafe coding practices.
+ */
+ Assert(!(proc == NULL && IsUnderPostmaster));
+
/*
* Lock out cancel/die interrupts until we exit the code section
* protected by the LWLock. This ensures that interrupts will not
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.117 2001/12/28 18:16:43 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.117.2.1 2002/09/30 20:18:59 tgl Exp $
*
*-------------------------------------------------------------------------
*/
/* Abort any buffer I/O in progress */
AbortBufferIO();
+ /* Release any buffer context locks we are holding */
+ UnlockBuffers();
+ /* Release any buffer reference counts we are holding */
+ ResetBufferPool(false);
/* Get off any wait queue I might be on */
LockWaitCancel();
/* Abort any buffer I/O in progress */
AbortBufferIO();
+ /* Release any buffer context locks we are holding */
+ UnlockBuffers();
+ /* Release any buffer reference counts we are holding */
+ ResetBufferPool(false);
/* I can't be on regular lock queues, so needn't check */