diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2000-12-18 00:44:50 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2000-12-18 00:44:50 +0000 |
commit | a626b78c8957f50ae6345015b249e996d9aab55d (patch) | |
tree | 352a378cead2660c6c4a1704007cfb0d96f96183 /src/include | |
parent | 8c8ed4f456f0b343d5df332e0ff31c6bb889429f (diff) | |
download | postgresql-a626b78c8957f50ae6345015b249e996d9aab55d.tar.gz postgresql-a626b78c8957f50ae6345015b249e996d9aab55d.zip |
Clean up backend-exit-time cleanup behavior. Use on_shmem_exit callbacks
to ensure that we have released buffer refcounts and so forth, rather than
putting ad-hoc operations before (some of the calls to) proc_exit. Add
commentary to discourage future hackers from repeating that mistake.
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/access/xlog.h | 4 | ||||
-rw-r--r-- | src/include/commands/trigger.h | 4 | ||||
-rw-r--r-- | src/include/libpq/libpq.h | 3 | ||||
-rw-r--r-- | src/include/storage/bufmgr.h | 3 | ||||
-rw-r--r-- | src/include/utils/elog.h | 20 |
5 files changed, 17 insertions, 17 deletions
diff --git a/src/include/access/xlog.h b/src/include/access/xlog.h index 269315dc78e..1c10501fb7d 100644 --- a/src/include/access/xlog.h +++ b/src/include/access/xlog.h @@ -3,7 +3,7 @@ * * PostgreSQL transaction log manager * - * $Header: /cvsroot/pgsql/src/include/access/xlog.h,v 1.13 2000/12/03 10:27:28 vadim Exp $ + * $Header: /cvsroot/pgsql/src/include/access/xlog.h,v 1.14 2000/12/18 00:44:48 tgl Exp $ */ #ifndef XLOG_H #define XLOG_H @@ -88,7 +88,7 @@ typedef XLogPageHeaderData *XLogPageHeader; extern StartUpID ThisStartUpID; /* current SUI */ extern bool InRecovery; extern XLogRecPtr MyLastRecPtr; -extern uint32 StopIfError; +extern uint32 CritSectionCount; typedef struct RmgrData { diff --git a/src/include/commands/trigger.h b/src/include/commands/trigger.h index 22dac3f5fe3..c9fbcae54a3 100644 --- a/src/include/commands/trigger.h +++ b/src/include/commands/trigger.h @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: trigger.h,v 1.21 2000/06/08 22:37:42 momjian Exp $ + * $Id: trigger.h,v 1.22 2000/12/18 00:44:48 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -129,7 +129,7 @@ typedef struct DeferredTriggerEventData typedef struct DeferredTriggerEventData *DeferredTriggerEvent; -extern int DeferredTriggerInit(void); +extern void DeferredTriggerInit(void); extern void DeferredTriggerBeginXact(void); extern void DeferredTriggerEndQuery(void); extern void DeferredTriggerEndXact(void); diff --git a/src/include/libpq/libpq.h b/src/include/libpq/libpq.h index c86862317c8..a8deb15eee2 100644 --- a/src/include/libpq/libpq.h +++ b/src/include/libpq/libpq.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: libpq.h,v 1.41 2000/11/14 01:15:04 momjian Exp $ + * $Id: libpq.h,v 1.42 2000/12/18 00:44:49 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -60,7 +60,6 @@ extern int StreamServerPort(int family, char *hostName, extern int StreamConnection(int server_fd, Port *port); extern void StreamClose(int sock); extern void pq_init(void); -extern void pq_close(void); extern int pq_getbytes(char *s, size_t len); extern int pq_getstring(StringInfo s); extern int pq_peekbyte(void); diff --git a/src/include/storage/bufmgr.h b/src/include/storage/bufmgr.h index 27bcc090ed9..7f1906441a8 100644 --- a/src/include/storage/bufmgr.h +++ b/src/include/storage/bufmgr.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: bufmgr.h,v 1.46 2000/11/30 08:46:26 vadim Exp $ + * $Id: bufmgr.h,v 1.47 2000/12/18 00:44:49 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -168,6 +168,7 @@ extern Buffer ReleaseAndReadBuffer(Buffer buffer, Relation relation, extern int FlushBuffer(Buffer buffer, bool sync, bool release); extern void InitBufferPool(void); +extern void InitBufferPoolAccess(void); extern void PrintBufferUsage(FILE *statfp); extern void ResetBufferUsage(void); extern void ResetBufferPool(bool isCommit); diff --git a/src/include/utils/elog.h b/src/include/utils/elog.h index acb82049730..37db2c7aaf8 100644 --- a/src/include/utils/elog.h +++ b/src/include/utils/elog.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: elog.h,v 1.20 2000/12/06 17:25:45 tgl Exp $ + * $Id: elog.h,v 1.21 2000/12/18 00:44:50 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -28,24 +28,24 @@ extern int Use_syslog; #endif /* - * If StopIfError > 0 signal handlers mustn't do + * If CritSectionCount > 0, signal handlers mustn't do * elog(ERROR|FATAL), instead remember what action is - * required with QueryCancel & ExitAfterAbort. + * required with QueryCancel & ProcDiePending. */ -extern uint32 StopIfError; /* duplicates access/xlog.h */ +extern uint32 CritSectionCount; /* duplicates access/xlog.h */ extern bool QueryCancel; /* duplicates miscadmin.h */ -extern bool ExitAfterAbort; +extern bool ProcDiePending; -#define START_CRIT_CODE (StopIfError++) +#define START_CRIT_CODE (CritSectionCount++) #define END_CRIT_CODE \ do { \ - if (!StopIfError) \ + if (CritSectionCount == 0) \ elog(STOP, "Not in critical section"); \ - StopIfError--; \ - if (!StopIfError && QueryCancel) \ + CritSectionCount--; \ + if (CritSectionCount == 0 && QueryCancel) \ { \ - if (ExitAfterAbort) \ + if (ProcDiePending) \ elog(FATAL, "The system is shutting down"); \ else \ elog(ERROR, "Query was cancelled."); \ |