mirror of
https://github.com/postgres/postgres.git
synced 2025-06-14 18:42:34 +03:00
Do not accept interrupts in RESUME_INTERRUPTS() and END_CRIT_SECTION()
macros, but only at explicit CHECK_FOR_INTERRUPTS() calls. Not clear whether overenthusiastic acceptance of interrupts accounts for any real bugs, but it definitely seems risky and unnecessary.
This commit is contained in:
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.243 2001/12/04 19:40:17 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.244 2002/01/01 23:16:22 tgl Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* this is the "main" module of the postgres backend and
|
* this is the "main" module of the postgres backend and
|
||||||
@ -1626,7 +1626,7 @@ PostgresMain(int argc, char *argv[], const char *username)
|
|||||||
if (!IsUnderPostmaster)
|
if (!IsUnderPostmaster)
|
||||||
{
|
{
|
||||||
puts("\nPOSTGRES backend interactive interface ");
|
puts("\nPOSTGRES backend interactive interface ");
|
||||||
puts("$Revision: 1.243 $ $Date: 2001/12/04 19:40:17 $\n");
|
puts("$Revision: 1.244 $ $Date: 2002/01/01 23:16:22 $\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1703,7 +1703,6 @@ PostgresMain(int argc, char *argv[], const char *username)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Exit interrupt holdoff section we implicitly established above.
|
* Exit interrupt holdoff section we implicitly established above.
|
||||||
* (This could result in accepting a cancel or die interrupt.)
|
|
||||||
*/
|
*/
|
||||||
RESUME_INTERRUPTS();
|
RESUME_INTERRUPTS();
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: miscadmin.h,v 1.97 2001/11/05 17:46:31 momjian Exp $
|
* $Id: miscadmin.h,v 1.98 2002/01/01 23:16:22 tgl Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* some of the information in this file should be moved to
|
* some of the information in this file should be moved to
|
||||||
@ -43,7 +43,8 @@
|
|||||||
* or die interrupt. The HOLD_INTERRUPTS() and RESUME_INTERRUPTS() macros
|
* or die interrupt. The HOLD_INTERRUPTS() and RESUME_INTERRUPTS() macros
|
||||||
* allow code to ensure that no cancel or die interrupt will be accepted,
|
* allow code to ensure that no cancel or die interrupt will be accepted,
|
||||||
* even if CHECK_FOR_INTERRUPTS() gets called in a subroutine. The interrupt
|
* even if CHECK_FOR_INTERRUPTS() gets called in a subroutine. The interrupt
|
||||||
* will be held off until the last matching RESUME_INTERRUPTS() occurs.
|
* will be held off until CHECK_FOR_INTERRUPTS() is done outside any
|
||||||
|
* HOLD_INTERRUPTS() ... RESUME_INTERRUPTS() section.
|
||||||
*
|
*
|
||||||
* Special mechanisms are used to let an interrupt be accepted when we are
|
* Special mechanisms are used to let an interrupt be accepted when we are
|
||||||
* waiting for a lock or when we are waiting for command input (but, of
|
* waiting for a lock or when we are waiting for command input (but, of
|
||||||
@ -85,8 +86,6 @@ extern void ProcessInterrupts(void);
|
|||||||
do { \
|
do { \
|
||||||
Assert(InterruptHoldoffCount > 0); \
|
Assert(InterruptHoldoffCount > 0); \
|
||||||
InterruptHoldoffCount--; \
|
InterruptHoldoffCount--; \
|
||||||
if (InterruptPending) \
|
|
||||||
ProcessInterrupts(); \
|
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
#define START_CRIT_SECTION() (CritSectionCount++)
|
#define START_CRIT_SECTION() (CritSectionCount++)
|
||||||
@ -95,8 +94,6 @@ extern void ProcessInterrupts(void);
|
|||||||
do { \
|
do { \
|
||||||
Assert(CritSectionCount > 0); \
|
Assert(CritSectionCount > 0); \
|
||||||
CritSectionCount--; \
|
CritSectionCount--; \
|
||||||
if (InterruptPending) \
|
|
||||||
ProcessInterrupts(); \
|
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user