mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +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:
5
src/backend/utils/cache/temprel.c
vendored
5
src/backend/utils/cache/temprel.c
vendored
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/temprel.c,v 1.32 2000/12/22 23:12:07 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/temprel.c,v 1.33 2001/01/12 21:54:00 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -263,8 +263,6 @@ AtEOXact_temp_relations(bool isCommit)
|
||||
temp_rel->created_in_cur_xact)
|
||||
{
|
||||
/* This entry must be removed */
|
||||
pfree(temp_rel);
|
||||
/* remove from linked list */
|
||||
if (prev != NIL)
|
||||
{
|
||||
lnext(prev) = lnext(l);
|
||||
@ -277,6 +275,7 @@ AtEOXact_temp_relations(bool isCommit)
|
||||
pfree(l);
|
||||
l = temp_rels;
|
||||
}
|
||||
pfree(temp_rel);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user