Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4764ae8

Browse files
committed
Do not accept interrupts in RESUME_INTERRUPTS() and END_CRIT_SECTION()
macros, but only at explicit CHECK_FOR_INTERRUPTS() calls. Not clearwhether overenthusiastic acceptance of interrupts accounts for any realbugs, but it definitely seems risky and unnecessary.
1 parent1ccc676 commit4764ae8

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

‎src/backend/tcop/postgres.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.243 2001/12/04 19:40:17 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.244 2002/01/01 23:16:22 tgl Exp $
1212
*
1313
* NOTES
1414
* this is the "main" module of the postgres backend and
@@ -1626,7 +1626,7 @@ PostgresMain(int argc, char *argv[], const char *username)
16261626
if (!IsUnderPostmaster)
16271627
{
16281628
puts("\nPOSTGRES backend interactive interface ");
1629-
puts("$Revision: 1.243 $ $Date:2001/12/04 19:40:17 $\n");
1629+
puts("$Revision: 1.244 $ $Date:2002/01/01 23:16:22 $\n");
16301630
}
16311631

16321632
/*
@@ -1703,7 +1703,6 @@ PostgresMain(int argc, char *argv[], const char *username)
17031703

17041704
/*
17051705
* Exit interrupt holdoff section we implicitly established above.
1706-
* (This could result in accepting a cancel or die interrupt.)
17071706
*/
17081707
RESUME_INTERRUPTS();
17091708
}

‎src/include/miscadmin.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
1313
* Portions Copyright (c) 1994, Regents of the University of California
1414
*
15-
* $Id: miscadmin.h,v 1.97 2001/11/05 17:46:31 momjian Exp $
15+
* $Id: miscadmin.h,v 1.98 2002/01/01 23:16:22 tgl Exp $
1616
*
1717
* NOTES
1818
* some of the information in this file should be moved to
@@ -43,7 +43,8 @@
4343
* or die interrupt. The HOLD_INTERRUPTS() and RESUME_INTERRUPTS() macros
4444
* allow code to ensure that no cancel or die interrupt will be accepted,
4545
* even if CHECK_FOR_INTERRUPTS() gets called in a subroutine.The interrupt
46-
* will be held off until the last matching RESUME_INTERRUPTS() occurs.
46+
* will be held off until CHECK_FOR_INTERRUPTS() is done outside any
47+
* HOLD_INTERRUPTS() ... RESUME_INTERRUPTS() section.
4748
*
4849
* Special mechanisms are used to let an interrupt be accepted when we are
4950
* waiting for a lock or when we are waiting for command input (but, of
@@ -85,8 +86,6 @@ extern void ProcessInterrupts(void);
8586
do { \
8687
Assert(InterruptHoldoffCount > 0); \
8788
InterruptHoldoffCount--; \
88-
if (InterruptPending) \
89-
ProcessInterrupts(); \
9089
} while(0)
9190

9291
#defineSTART_CRIT_SECTION() (CritSectionCount++)
@@ -95,8 +94,6 @@ extern void ProcessInterrupts(void);
9594
do { \
9695
Assert(CritSectionCount > 0); \
9796
CritSectionCount--; \
98-
if (InterruptPending) \
99-
ProcessInterrupts(); \
10097
} while(0)
10198

10299

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp