1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-25 13:17:41 +03:00

Add more critical-section calls: all code sections that hold spinlocks

are now critical sections, so as to ensure die() won't interrupt us while
we are munging shared-memory data structures.  Avoid insecure intermediate
states in some code that proc_exit will call, like palloc/pfree.  Rename
START/END_CRIT_CODE to START/END_CRIT_SECTION, since that seems to be
what people tend to call them anyway, and make them be called with () like
a function call, in hopes of not confusing pg_indent.
I doubt that this is sufficient to make SIGTERM safe anywhere; there's
just too much code that could get invoked during proc_exit().
This commit is contained in:
Tom Lane
2001-01-12 21:54:01 +00:00
parent be8477bc37
commit 6162432de9
17 changed files with 163 additions and 129 deletions

View File

@@ -3,7 +3,7 @@
*
* PostgreSQL transaction log manager
*
* $Header: /cvsroot/pgsql/src/include/access/xlog.h,v 1.15 2000/12/28 13:00:25 vadim Exp $
* $Header: /cvsroot/pgsql/src/include/access/xlog.h,v 1.16 2001/01/12 21:54:01 tgl Exp $
*/
#ifndef XLOG_H
#define XLOG_H
@@ -101,7 +101,7 @@ typedef XLogPageHeaderData *XLogPageHeader;
extern StartUpID ThisStartUpID; /* current SUI */
extern bool InRecovery;
extern XLogRecPtr MyLastRecPtr;
extern uint32 CritSectionCount;
extern volatile uint32 CritSectionCount;
typedef struct RmgrData
{