mirror of
https://github.com/postgres/postgres.git
synced 2025-10-25 13:17:41 +03:00
Code review for EXEC_BACKEND changes. Reduce the number of #ifdefs by
about a third, make it work on non-Windows platforms again. (But perhaps I broke the WIN32 code, since I have no way to test that.) Fold all the paths that fork postmaster child processes to go through the single routine SubPostmasterMain, which takes care of resurrecting the state that would normally be inherited from the postmaster (including GUC variables). Clean up some places where there's no particularly good reason for the EXEC and non-EXEC cases to work differently. Take care of one or two FIXMEs that remained in the code.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
* Portions Copyright (c) 2003, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/access/slru.h,v 1.4 2003/11/29 22:40:55 pgsql Exp $
|
||||
* $PostgreSQL: pgsql/src/include/access/slru.h,v 1.5 2004/05/28 05:13:17 tgl Exp $
|
||||
*/
|
||||
#ifndef SLRU_H
|
||||
#define SLRU_H
|
||||
@@ -16,35 +16,38 @@
|
||||
/* exported because lwlock.c needs it */
|
||||
#define NUM_CLOG_BUFFERS 8
|
||||
|
||||
/*
|
||||
* Note: the separation between SlruLockData and SlruSharedData is purely
|
||||
* historical; the structs could be combined.
|
||||
*/
|
||||
typedef struct SlruLockData
|
||||
{
|
||||
LWLockId ControlLock;
|
||||
/*
|
||||
* BufferLocks is set during CLOGShmemInit and does not change thereafter.
|
||||
* The value is automatically inherited by backends via fork, and
|
||||
* doesn't need to be in shared memory.
|
||||
*/
|
||||
LWLockId BufferLocks[NUM_CLOG_BUFFERS]; /* Per-buffer I/O locks */
|
||||
} SlruLockData;
|
||||
typedef SlruLockData *SlruLock;
|
||||
|
||||
/*
|
||||
* SlruCtlData is an unshared structure that points to the active information
|
||||
* in shared memory.
|
||||
*/
|
||||
typedef struct SlruCtlData
|
||||
{
|
||||
void *shared; /* pointer to SlruSharedData */
|
||||
SlruLock locks;
|
||||
|
||||
/*
|
||||
* Dir is set during SimpleLruShmemInit and does not change thereafter.
|
||||
* The value is automatically inherited by backends via fork, and
|
||||
* doesn't need to be in shared memory.
|
||||
*/
|
||||
/*
|
||||
* Dir is set during SimpleLruShmemInit and does not change thereafter.
|
||||
* The value is automatically inherited by backends via fork, and
|
||||
* doesn't need to be in shared memory.
|
||||
*/
|
||||
char Dir[MAXPGPATH];
|
||||
|
||||
/*
|
||||
* Decide which of two page numbers is "older" for truncation purposes.
|
||||
* We need to use comparison of TransactionIds here in order to do the right
|
||||
* thing with wraparound XID arithmetic.
|
||||
*/
|
||||
/*
|
||||
* Decide which of two page numbers is "older" for truncation purposes.
|
||||
* We need to use comparison of TransactionIds here in order to do the
|
||||
* right thing with wraparound XID arithmetic.
|
||||
*/
|
||||
bool (*PagePrecedes) (int, int);
|
||||
|
||||
} SlruCtlData;
|
||||
|
||||
Reference in New Issue
Block a user