aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam/xlog.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2000-12-18 00:44:50 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2000-12-18 00:44:50 +0000
commita626b78c8957f50ae6345015b249e996d9aab55d (patch)
tree352a378cead2660c6c4a1704007cfb0d96f96183 /src/backend/access/transam/xlog.c
parent8c8ed4f456f0b343d5df332e0ff31c6bb889429f (diff)
downloadpostgresql-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/backend/access/transam/xlog.c')
-rw-r--r--src/backend/access/transam/xlog.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 3b2c5461dcd..ba85f4b60d0 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.42 2000/12/11 19:27:42 vadim Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.43 2000/12/18 00:44:45 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -40,7 +40,7 @@
int XLOGbuffers = 8;
XLogRecPtr MyLastRecPtr = {0, 0};
-uint32 StopIfError = 0;
+uint32 CritSectionCount = 0;
bool InRecovery = false;
StartUpID ThisStartUpID = 0;
@@ -1531,7 +1531,7 @@ StartupXLOG()
char buffer[MAXLOGRECSZ + SizeOfXLogRecord];
elog(LOG, "starting up");
- StopIfError++;
+ CritSectionCount++;
XLogCtl->xlblocks = (XLogRecPtr *) (((char *) XLogCtl) + sizeof(XLogCtlData));
XLogCtl->pages = ((char *) XLogCtl->xlblocks + sizeof(XLogRecPtr) * XLOGbuffers);
@@ -1748,7 +1748,7 @@ StartupXLOG()
XLogCtl->ThisStartUpID = ThisStartUpID;
elog(LOG, "database system is in production state");
- StopIfError--;
+ CritSectionCount--;
return;
}
@@ -1771,10 +1771,10 @@ ShutdownXLOG()
{
elog(LOG, "shutting down");
- StopIfError++;
+ CritSectionCount++;
CreateDummyCaches();
CreateCheckPoint(true);
- StopIfError--;
+ CritSectionCount--;
elog(LOG, "database system is shut down");
}